[SSK] Missed calls increment unread counter

Avoid deadlock by moving unrelated DB work out of transaction

// FREEBIE
pull/1/head
Michael Kirk 8 years ago
parent dc9ffe40e5
commit c621e3a000

@ -140,7 +140,7 @@ CHECKOUT OPTIONS:
:commit: 919d541d6b8a8802a94f943026b8f68394e2c0b8
:git: https://github.com/WhisperSystems/SignalProtocolKit.git
SignalServiceKit:
:commit: 653727ae9f00d6b7dec5c92813a295ae0bccbe91
:commit: 311d80fb2e8b8f2a0170a956b6964e2b6c7d0155
:git: https://github.com/WhisperSystems/SignalServiceKit.git
SocketRocket:
:commit: 41b57bb2fc292a814f758441a05243eb38457027

@ -189,6 +189,8 @@ typedef enum : NSUInteger {
isGroupConversation = [self.thread isKindOfClass:[TSGroupThread class]];
_composeOnOpen = keyboardAppearing;
[self markAllMessagesAsRead];
[self.uiDatabaseConnection beginLongLivedReadTransaction];
self.messageMappings =
[[YapDatabaseViewMappings alloc] initWithGroups:@[ thread.uniqueId ] view:TSMessageDatabaseViewExtensionName];
@ -196,7 +198,6 @@ typedef enum : NSUInteger {
[self.messageMappings updateWithTransaction:transaction];
self.page = 0;
[self updateRangeOptionsForPage:self.page];
[self markAllMessagesAsRead];
[self.collectionView reloadData];
}];
[self updateLoadEarlierVisible];

Loading…
Cancel
Save