Properly destroy cache objects of vanished folders
parent
037dd67635
commit
006727a74b
|
@ -457,13 +457,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
NSData *d;
|
NSData *d;
|
||||||
|
|
||||||
//
|
//
|
||||||
// We mark the cache object as deleted
|
// We destroy the cache object
|
||||||
//
|
//
|
||||||
key = [NSString stringWithFormat: @"%@+%@", [context objectForKey: @"DeviceId"], [folderToDelete nameInContainer]];
|
key = [NSString stringWithFormat: @"%@+%@", [context objectForKey: @"DeviceId"], [folderToDelete nameInContainer]];
|
||||||
o = [SOGoCacheGCSObject objectWithName: key inContainer: nil];
|
o = [SOGoCacheGCSObject objectWithName: key inContainer: nil];
|
||||||
[o setTableUrl: [self folderTableURL]];
|
[o setTableUrl: [self folderTableURL]];
|
||||||
[o reloadIfNeeded];
|
[o destroy];
|
||||||
[o delete];
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// We update the FolderSync's synckey
|
// We update the FolderSync's synckey
|
||||||
|
@ -697,7 +696,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
if (![imapGUIDs allKeysForObject: cKey])
|
if (![imapGUIDs allKeysForObject: cKey])
|
||||||
{
|
{
|
||||||
// Delete folders cache content to avoid stale data if a new folder gets created with the same name
|
// Destroy folders cache content to avoid stale data if a new folder gets created with the same name
|
||||||
key = [NSString stringWithFormat: @"%@+folder%@", [context objectForKey: @"DeviceId"], [cachedGUIDs objectForKey: cKey]];
|
key = [NSString stringWithFormat: @"%@+folder%@", [context objectForKey: @"DeviceId"], [cachedGUIDs objectForKey: cKey]];
|
||||||
o = [SOGoCacheGCSObject objectWithName: key inContainer: nil];
|
o = [SOGoCacheGCSObject objectWithName: key inContainer: nil];
|
||||||
[o setObjectType: ActiveSyncFolderCacheObject];
|
[o setObjectType: ActiveSyncFolderCacheObject];
|
||||||
|
@ -711,8 +710,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
command_count++;
|
command_count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
[[o properties] removeAllObjects];
|
[o destroy];
|
||||||
[o save];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
1
NEWS
1
NEWS
|
@ -16,6 +16,7 @@ Bug fixes
|
||||||
- we now correctly add the "METHOD:REPLY" when sending out ITIP messages from DAV clients
|
- we now correctly add the "METHOD:REPLY" when sending out ITIP messages from DAV clients
|
||||||
- fixed refresh of message headers when forwarding a message (#2818)
|
- fixed refresh of message headers when forwarding a message (#2818)
|
||||||
- we now correctly escape all charset= in <meta> tags, not only in the <head>
|
- we now correctly escape all charset= in <meta> tags, not only in the <head>
|
||||||
|
- we now destroy cache objects of vanished folders
|
||||||
|
|
||||||
2.2.6 (2014-07-02)
|
2.2.6 (2014-07-02)
|
||||||
------------------
|
------------------
|
||||||
|
|
|
@ -456,6 +456,40 @@ static EOAttribute *textColumn = nil;
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSException *) destroy
|
||||||
|
{
|
||||||
|
NSString *tableName, *pathValue, *sql;
|
||||||
|
EOAdaptorChannel *channel;
|
||||||
|
GCSChannelManager *cm;
|
||||||
|
NSException *result;
|
||||||
|
EOAdaptor *adaptor;
|
||||||
|
|
||||||
|
cm = [GCSChannelManager defaultChannelManager];
|
||||||
|
channel = [cm acquireOpenChannelForURL: [self tableUrl]];
|
||||||
|
tableName = [self tableName];
|
||||||
|
|
||||||
|
adaptor = [[channel adaptorContext] adaptor];
|
||||||
|
pathValue = [adaptor formatValue: [self path]
|
||||||
|
forAttribute: textColumn];
|
||||||
|
result = nil;
|
||||||
|
|
||||||
|
sql = [NSString stringWithFormat:
|
||||||
|
(@"DELETE FROM %@"
|
||||||
|
@" WHERE c_path = %@"),
|
||||||
|
tableName,
|
||||||
|
pathValue];
|
||||||
|
|
||||||
|
result = [channel evaluateExpressionX: sql];
|
||||||
|
|
||||||
|
if (result)
|
||||||
|
[self errorWithFormat: @"could not delete record %@"
|
||||||
|
@" in %@: %@", pathValue, tableName, result];
|
||||||
|
|
||||||
|
[cm releaseChannel: channel];
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
- (void) save
|
- (void) save
|
||||||
{
|
{
|
||||||
NSString *sql;
|
NSString *sql;
|
||||||
|
|
|
@ -42,6 +42,8 @@
|
||||||
- (NSCalendarDate *) creationDate;
|
- (NSCalendarDate *) creationDate;
|
||||||
- (NSCalendarDate *) lastModified;
|
- (NSCalendarDate *) lastModified;
|
||||||
|
|
||||||
|
- (NSException *) destroy;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
#endif /* SOGOCACHEOBJECT_H */
|
#endif /* SOGOCACHEOBJECT_H */
|
||||||
|
|
Loading…
Reference in New Issue