Add additional upload validation to UploadAttachmentToArchiveJob.

This commit is contained in:
Greyson Parrelli
2026-02-25 18:38:38 +00:00
parent 080b1aab83
commit f439e1f8e3

View File

@@ -145,6 +145,17 @@ class UploadAttachmentToArchiveJob private constructor(
if (attachment.uri == null) {
Log.w(TAG, "[$attachmentId]$mediaIdLog Attachment has no uri! Cannot upload.")
ArchiveDatabaseExecutor.runBlocking {
setArchiveTransferStateWithDelayedNotification(attachmentId, AttachmentTable.ArchiveTransferState.PERMANENT_FAILURE)
}
return Result.failure()
}
if (attachment.size == 0L) {
Log.w(TAG, "[$attachmentId]$mediaIdLog Attachment has no data (size is 0)! Cannot upload.")
ArchiveDatabaseExecutor.runBlocking {
setArchiveTransferStateWithDelayedNotification(attachmentId, AttachmentTable.ArchiveTransferState.PERMANENT_FAILURE)
}
return Result.failure()
}