From 34811a635be02ac0762336eea25753472b06f9e7 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Mon, 20 Nov 2017 16:54:14 -0500 Subject: [PATCH] Fixes: "connected call" showing as "unconnected outgoing" call. Expire viewItem cache when resetting mappings // FREEBIE --- .../ConversationView/ConversationViewController.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m index c7febd917..ca0733f40 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m @@ -3941,7 +3941,13 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) { CGFloat viewTopToContentBottom = self.safeContentHeight - self.collectionView.contentOffset.y; NSUInteger oldCellCount = [self.messageMappings numberOfItemsInGroup:self.thread.uniqueId]; + [self resetMappings]; + + // ViewItem's modified while we were not observing may be stale. + // TODO have a more fine-grained cache expiration based on rows modified. + [self.viewItemMap removeAllObjects]; + NSUInteger newCellCount = [self.messageMappings numberOfItemsInGroup:self.thread.uniqueId]; // Detect changes in the mapping's "window" size.