From 94b59c326ebd568afcfdaf97e9175fc38c02a9f2 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Wed, 15 Nov 2017 06:53:05 -0500 Subject: [PATCH] Rework the "update with..." methods to avoid re-saving deleted models. --- SignalServiceKit/src/Messages/OWSMessageSender.m | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/SignalServiceKit/src/Messages/OWSMessageSender.m b/SignalServiceKit/src/Messages/OWSMessageSender.m index 82ffe293c..84cba896f 100644 --- a/SignalServiceKit/src/Messages/OWSMessageSender.m +++ b/SignalServiceKit/src/Messages/OWSMessageSender.m @@ -718,12 +718,7 @@ NSString *const OWSMessageSenderRateLimitedException = @"RateLimitedException"; success:^{ DDLogInfo(@"%@ Marking group message as sent to recipient: %@", self.logTag, recipient.uniqueId); [self.dbConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) { - // Update the message unless it has been deleted. - if ([TSOutgoingMessage fetchObjectWithUniqueID:message.uniqueId]) { - [message updateWithSentRecipient:recipient.uniqueId transaction:transaction]; - } else { - DDLogInfo(@"%@ not marking message as sent to recipient; message deleted.", self.logTag); - } + [message updateWithSentRecipient:recipient.uniqueId transaction:transaction]; }]; [futureSource trySetResult:@1]; }