From 5453f101ff55dc36f9d6a6166781a22161eef40a Mon Sep 17 00:00:00 2001 From: Cody Henthorne Date: Fri, 25 Apr 2025 12:50:06 -0400 Subject: [PATCH] Fix BackupRestoreMediaJob not correctly paging through attachments. --- .../org/thoughtcrime/securesms/jobs/BackupRestoreMediaJob.kt | 2 +- .../org/thoughtcrime/securesms/jobs/RestoreAttachmentJob.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/jobs/BackupRestoreMediaJob.kt b/app/src/main/java/org/thoughtcrime/securesms/jobs/BackupRestoreMediaJob.kt index e396223ed3..ac354f8d5c 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/jobs/BackupRestoreMediaJob.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/jobs/BackupRestoreMediaJob.kt @@ -103,7 +103,7 @@ class BackupRestoreMediaJob private constructor(parameters: Parameters) : BaseJo // Intentionally enqueues one at a time for safer attachment transfer state management restoreThumbnailJobs.forEach { jobManager.add(it) } restoreFullAttachmentJobs.forEach { jobManager.add(it) } - } while (restoreThumbnailJobs.isNotEmpty() && restoreFullAttachmentJobs.isNotEmpty() && notRestorable.isNotEmpty()) + } while (restoreThumbnailJobs.isNotEmpty() || restoreFullAttachmentJobs.isNotEmpty() || notRestorable.isNotEmpty()) SignalStore.backup.totalRestorableAttachmentSize = SignalDatabase.attachments.getRemainingRestorableAttachmentSize() diff --git a/app/src/main/java/org/thoughtcrime/securesms/jobs/RestoreAttachmentJob.kt b/app/src/main/java/org/thoughtcrime/securesms/jobs/RestoreAttachmentJob.kt index cdef890a26..91d2cd9446 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/jobs/RestoreAttachmentJob.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/jobs/RestoreAttachmentJob.kt @@ -268,7 +268,7 @@ class RestoreAttachmentJob private constructor( throw IOException("Failed to delete temp download file following range exception") } } catch (e: InvalidAttachmentException) { - Log.w(TAG, "Experienced exception while trying to download an attachment.", e) + Log.w(TAG, e.message) markFailed(attachmentId) } catch (e: NonSuccessfulResponseCodeException) { if (SignalStore.backup.backsUpMedia) {