From 06bdc3613678b2b7b99a80cce557331bd28893b6 Mon Sep 17 00:00:00 2001 From: Greyson Parrelli Date: Sun, 28 Dec 2025 09:21:14 -0500 Subject: [PATCH] Properly handle 413s when uploading to archive. Fixes #14502 --- .../securesms/jobs/UploadAttachmentToArchiveJob.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/src/main/java/org/thoughtcrime/securesms/jobs/UploadAttachmentToArchiveJob.kt b/app/src/main/java/org/thoughtcrime/securesms/jobs/UploadAttachmentToArchiveJob.kt index 5aeb97ba21..dfbdb1a977 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/jobs/UploadAttachmentToArchiveJob.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/jobs/UploadAttachmentToArchiveJob.kt @@ -284,6 +284,14 @@ class UploadAttachmentToArchiveJob private constructor( Log.w(TAG, "[$attachmentId] 400 likely means bad resumable state. Clearing upload spec before retrying.") uploadSpec = null } + 413 -> { + Log.w(TAG, "[$attachmentId] 413 means the attachment was too large. We've seen this happen with frankenstein imports using third party tools. This can never succeed.") + ArchiveDatabaseExecutor.runBlocking { + setArchiveTransferStateWithDelayedNotification(attachmentId, AttachmentTable.ArchiveTransferState.PERMANENT_FAILURE) + } + uploadSpec = null + return Result.failure() + } } return Result.retry(defaultBackoff()) }