From 46b09ec8d172f5c780695bb40ae86a5ed13100cd Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Sat, 15 Mar 2025 05:56:19 +1000 Subject: [PATCH] Ensure that download is no longer pending on abort --- ts/jobs/AttachmentDownloadManager.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ts/jobs/AttachmentDownloadManager.ts b/ts/jobs/AttachmentDownloadManager.ts index 32b315d5a9..1173696951 100644 --- a/ts/jobs/AttachmentDownloadManager.ts +++ b/ts/jobs/AttachmentDownloadManager.ts @@ -383,6 +383,16 @@ async function runDownloadAttachmentJob({ `${logId}: Cancelled attempt ${job.attempts}. Not scheduling a retry. Error:`, Errors.toLogFormat(error) ); + // Remove `pending` flag from the attachment. User can retry later. + await addAttachmentToMessage( + message.id, + { + ...job.attachment, + pending: false, + }, + logId, + { type: job.attachmentType } + ); return { status: 'finished' }; }