From ef5c3a5bc9bb34dea8a8d029ab719ef6bde74596 Mon Sep 17 00:00:00 2001 From: trevor-signal <131492920+trevor-signal@users.noreply.github.com> Date: Thu, 3 Apr 2025 12:26:11 -0400 Subject: [PATCH] Update attachment error handling for 403 status responses --- ts/util/downloadAttachment.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ts/util/downloadAttachment.ts b/ts/util/downloadAttachment.ts index 0cfe4dd0da..671195cc62 100644 --- a/ts/util/downloadAttachment.ts +++ b/ts/util/downloadAttachment.ts @@ -98,12 +98,9 @@ export async function downloadAttachment({ // may just need to wait for this attachment to end up on the backup tier throw error; } - // Attachments on the transit tier expire after 30 days, then start returning 404 or - // 403 - if ( - error instanceof HTTPError && - (error.code === 404 || error.code === 403) - ) { + // Attachments on the transit tier expire after (message queue length + buffer) days, + // then start returning 404 + if (error instanceof HTTPError && error.code === 404) { throw new AttachmentPermanentlyUndownloadableError(`HTTP ${error.code}`); } else { throw error;