From 730517fd7260b3744a0c6fa3c61099d1e4e29686 Mon Sep 17 00:00:00 2001 From: automated-signal <37887102+automated-signal@users.noreply.github.com> Date: Wed, 1 May 2024 15:07:17 -0500 Subject: [PATCH] Ensure attachmentDownloadQueue retains fresh attributes Co-authored-by: trevor-signal <131492920+trevor-signal@users.noreply.github.com> --- ts/util/attachmentDownloadQueue.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ts/util/attachmentDownloadQueue.ts b/ts/util/attachmentDownloadQueue.ts index de53011940..09bca78fa3 100644 --- a/ts/util/attachmentDownloadQueue.ts +++ b/ts/util/attachmentDownloadQueue.ts @@ -66,7 +66,11 @@ export async function flushAttachmentDownloadQueue(): Promise { ); const messagesWithDownloads = await Promise.all( - attachmentsToDownload.map(message => message.queueAttachmentDownloads()) + attachmentsToDownload.map(message => { + const updatedMessage = + window.MessageCache.__DEPRECATED$getById(message.id) ?? message; + return updatedMessage.queueAttachmentDownloads(); + }) ); const messagesToSave: Array = []; messagesWithDownloads.forEach((shouldSave, messageKey) => {