Skip to content

Commit f6f5d3d

Browse files
committed
Merge branch 'charlesmchen/invalidateMessageAdapterCache'
2 parents 4f0b583 + b39c490 commit f6f5d3d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Signal/src/ViewControllers/ConversationView/MessagesViewController.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,8 @@ - (void)viewWillAppear:(BOOL)animated
561561
// or on another device.
562562
[self hideInputIfNeeded];
563563

564+
self.messageAdapterCache = [[NSCache alloc] init];
565+
564566
// We need to `beginLongLivedReadTransaction` before we update our
565567
// mapping in order to jump to the most recent commit.
566568
[self.uiDatabaseConnection beginLongLivedReadTransaction];
@@ -3306,6 +3308,7 @@ - (void)yapDatabaseModified:(NSNotification *)notification
33063308
[self.collectionView deleteItemsAtIndexPaths:@[ rowChange.indexPath ]];
33073309

33083310
YapCollectionKey *collectionKey = rowChange.collectionKey;
3311+
OWSAssert(collectionKey.key.length > 0);
33093312
if (collectionKey.key) {
33103313
[self.messageAdapterCache removeObjectForKey:collectionKey.key];
33113314
}
@@ -3329,6 +3332,7 @@ - (void)yapDatabaseModified:(NSNotification *)notification
33293332
}
33303333
case YapDatabaseViewChangeUpdate: {
33313334
YapCollectionKey *collectionKey = rowChange.collectionKey;
3335+
OWSAssert(collectionKey.key.length > 0);
33323336
if (collectionKey.key) {
33333337
[self.messageAdapterCache removeObjectForKey:collectionKey.key];
33343338
}

0 commit comments

Comments
 (0)