From 2434d5f16e80dd503b2d33dab28d35ab664f8675 Mon Sep 17 00:00:00 2001 From: Jamie Kyle <113370520+jamiebuilds-signal@users.noreply.github.com> Date: Thu, 8 Feb 2024 18:17:52 -0800 Subject: [PATCH] Handle 403 errors on attachments --- ts/util/downloadAttachment.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ts/util/downloadAttachment.ts b/ts/util/downloadAttachment.ts index 0be52b9480bd..7ab95e8c2f4a 100644 --- a/ts/util/downloadAttachment.ts +++ b/ts/util/downloadAttachment.ts @@ -28,8 +28,8 @@ export async function downloadAttachment( try { downloaded = await doDownloadAttachment(server, migratedAttachment); } catch (error) { - // Attachments on the server expire after 30 days, then start returning 404 - if (error && error.code === 404) { + // Attachments on the server expire after 30 days, then start returning 404 or 403 + if (error && (error.code === 404 || error.code === 403)) { return null; }