diff --git a/SignalMessaging/contacts/OWSContactsManager.m b/SignalMessaging/contacts/OWSContactsManager.m index 44c8a1111..d7f453127 100644 --- a/SignalMessaging/contacts/OWSContactsManager.m +++ b/SignalMessaging/contacts/OWSContactsManager.m @@ -140,7 +140,16 @@ NSString *const OWSContactsManagerSignalAccountsDidChangeNotification updatedContacts:(NSArray *)contacts isUserRequested:(BOOL)isUserRequested { - [self updateWithContacts:contacts shouldClearStaleCache:isUserRequested]; + BOOL shouldClearStaleCache; + // On iOS 11.2, only clear the contacts cache if the fetch was initiated by the user. + // iOS 11.2 rarely returns partial fetches and we use the cache to prevent contacts from + // periodically disappearing from the UI. + if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(11, 2) && !SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(11, 3)) { + shouldClearStaleCache = isUserRequested; + } else { + shouldClearStaleCache = YES; + } + [self updateWithContacts:contacts shouldClearStaleCache:shouldClearStaleCache]; } #pragma mark - Intersection