From 0fe142df17cdafa61e7ec82dd93a09856dbed6da Mon Sep 17 00:00:00 2001 From: Harry <109690906+harry-signal@users.noreply.github.com> Date: Tue, 5 Nov 2024 15:18:52 -0800 Subject: [PATCH] Ignore read cache when updating TSAttachment schema version --- Signal/src/ViewControllers/ForwardMessageViewController.swift | 3 ++- SignalServiceKit/Messages/Attachments/TSAttachment.m | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Signal/src/ViewControllers/ForwardMessageViewController.swift b/Signal/src/ViewControllers/ForwardMessageViewController.swift index bbcceea90a7..126fa240312 100644 --- a/Signal/src/ViewControllers/ForwardMessageViewController.swift +++ b/Signal/src/ViewControllers/ForwardMessageViewController.swift @@ -339,7 +339,8 @@ extension ForwardMessageViewController { let interactionId = item.interaction?.uniqueId, let latestInteraction = TSInteraction.anyFetch( uniqueId: interactionId, - transaction: transaction + transaction: transaction, + ignoreCache: true ), hasRenderableContent(interaction: latestInteraction, tx: transaction) else { diff --git a/SignalServiceKit/Messages/Attachments/TSAttachment.m b/SignalServiceKit/Messages/Attachments/TSAttachment.m index 6c8cdc624d8..b060ed3dc68 100644 --- a/SignalServiceKit/Messages/Attachments/TSAttachment.m +++ b/SignalServiceKit/Messages/Attachments/TSAttachment.m @@ -276,7 +276,8 @@ - (void)upgradeAttachmentSchemaVersionIfNecessary // Async save the schema update in the database DatabaseStorageAsyncWrite(SSKEnvironment.shared.databaseStorageRef, ^(SDSAnyWriteTransaction *transaction) { TSAttachment *_Nullable latestInstance = [TSAttachment anyFetchWithUniqueId:self.uniqueId - transaction:transaction]; + transaction:transaction + ignoreCache:true]; if (latestInstance == nil) { return; }