Respond to CR.

pull/1/head
Matthew Chen 7 years ago
parent 39c820b866
commit 1c7add2b8f

@ -84,8 +84,7 @@ NSString *const OWSContactsManagerKeyNextFullIntersectionDate = @"OWSContactsMan
[AppReadiness runNowOrWhenAppWillBecomeReady:^{
[self setup];
}];
[AppReadiness runNowOrWhenAppDidBecomeReady:^{
[self startObserving];
}];
@ -409,10 +408,12 @@ NSString *const OWSContactsManagerKeyNextFullIntersectionDate = @"OWSContactsMan
{
OWSAssertIsOnMainThread();
NSString *recipientId = notification.userInfo[kNSNotificationKey_ProfileRecipientId];
OWSAssertDebug(recipientId.length > 0);
[AppReadiness runNowOrWhenAppDidBecomeReady:^{
NSString *recipientId = notification.userInfo[kNSNotificationKey_ProfileRecipientId];
OWSAssertDebug(recipientId.length > 0);
[self.avatarCache removeAllImagesForKey:recipientId];
[self.avatarCache removeAllImagesForKey:recipientId];
}];
}
- (void)updateWithContacts:(NSArray<Contact *> *)contacts

@ -270,7 +270,9 @@ NSString *const OWSMessageContentJobFinderExtensionGroup = @"OWSMessageContentJo
// Start processing.
[AppReadiness runNowOrWhenAppDidBecomeReady:^{
[self drainQueue];
if (CurrentAppContext().isMainApp) {
[self drainQueue];
}
}];
return self;

@ -249,7 +249,9 @@ NSString *const OWSMessageDecryptJobFinderExtensionGroup = @"OWSMessageProcessin
_isDrainingQueue = NO;
[AppReadiness runNowOrWhenAppDidBecomeReady:^{
[self drainQueue];
if (CurrentAppContext().isMainApp) {
[self drainQueue];
}
}];
return self;

@ -65,6 +65,8 @@ public class MessageSenderJobQueue: NSObject, JobQueue {
}
private func add(message: TSOutgoingMessage, removeMessageAfterSending: Bool, transaction: YapDatabaseReadWriteTransaction) {
assert(AppReadiness.isAppReady())
let jobRecord: SSKMessageSenderJobRecord
do {
jobRecord = try SSKMessageSenderJobRecord(message: message, removeMessageAfterSending: false, label: self.jobRecordLabel)

@ -106,6 +106,7 @@ public extension JobQueue {
func add(jobRecord: JobRecordType, transaction: YapDatabaseReadWriteTransaction) {
assert(jobRecord.status == .ready)
jobRecord.save(with: transaction)
transaction.addCompletionQueue(.global()) {

Loading…
Cancel
Save