Merge branch 'mkirk/crash-on-first-message'

pull/1/head
Michael Kirk 7 years ago
commit b358a75e3e

@ -154,11 +154,13 @@ NSString *const kNSNotificationName_IdentityStateDidChange = @"kNSNotificationNa
return identityKeyPair;
}
// This method should only be called from SignalProtocolKit, which doesn't know about YapDatabaseTransactions.
// Whenever possible, prefer to call the strongly typed variant: `identityKeyPairWithTransaction:`.
- (nullable ECKeyPair *)identityKeyPair:(nullable id)protocolContext
{
OWSAssert([protocolContext isKindOfClass:[YapDatabaseReadWriteTransaction class]]);
OWSAssert([protocolContext isKindOfClass:[YapDatabaseReadTransaction class]]);
YapDatabaseReadWriteTransaction *transaction = protocolContext;
YapDatabaseReadTransaction *transaction = protocolContext;
return [self identityKeyPairWithTransaction:transaction];
}
@ -449,7 +451,7 @@ NSString *const kNSNotificationName_IdentityStateDidChange = @"kNSNotificationNa
OWSAssert(transaction);
if ([[TSAccountManager localNumber] isEqualToString:recipientId]) {
ECKeyPair *_Nullable localIdentityKeyPair = [self identityKeyPair:transaction];
ECKeyPair *_Nullable localIdentityKeyPair = [self identityKeyPairWithTransaction:transaction];
if ([localIdentityKeyPair.publicKey isEqualToData:identityKey]) {
return YES;

@ -1328,6 +1328,8 @@ NSString *const OWSMessageSenderRateLimitedException = @"RateLimitedException";
}
dispatch_semaphore_signal(sema);
}];
// FIXME: Currently this happens within a readwrite transaction - meaning our read-write transaction blocks
// on a network request.
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
if (exception) {
@throw exception;

Loading…
Cancel
Save