Properly handle 413s when uploading to archive.

Fixes #14502
This commit is contained in:
Greyson Parrelli
2025-12-28 09:21:14 -05:00
committed by jeffrey-signal
parent 6e4edbd12d
commit 06bdc36136

View File

@@ -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())
}