In theory, this should have already been handled by the YapDatabaseRelationship extension via edges. However, in practice, there were situations (cause unknown) where interactions would exist without an edge to their corresponding thread. Rather than being clever with the edge/callback machinery, now threads explicitly delete all their interactions, and interactions delete all their attachments (when applicable). Also, a class to clean up spurious interactions / attachments In the process: - refactored TSYapDatabaseObject init to specify designated initializer - added some testing niceties to TSYapDatabaseObject // FREEBIE
11 lines
223 B
Objective-C
11 lines
223 B
Objective-C
// Copyright (c) 2016 Open Whisper Systems. All rights reserved.
|
|
|
|
@interface OWSOrphanedDataCleaner : NSObject
|
|
|
|
/**
|
|
* Remove any inaccessible data left behind due to application bugs.
|
|
*/
|
|
- (void)removeOrphanedData;
|
|
|
|
@end
|