Reset backup restore state after media restoration completes.

Fixes an issue where the SignalStore.backup.restoreState is never updated from RESTORING_MEDIA after completion of the media restoration.
This commit is contained in:
jeffrey-signal
2025-06-20 14:37:19 -04:00
committed by Cody Henthorne
parent bbec0f5f48
commit 3b9dec5d42

View File

@@ -6,6 +6,7 @@
package org.thoughtcrime.securesms.jobs
import org.signal.core.util.logging.Log
import org.thoughtcrime.securesms.backup.RestoreState
import org.thoughtcrime.securesms.database.SignalDatabase
import org.thoughtcrime.securesms.jobmanager.Job
import org.thoughtcrime.securesms.keyvalue.SignalStore
@@ -40,7 +41,9 @@ class CheckRestoreMediaLeftJob private constructor(parameters: Parameters) : Job
val remainingAttachmentSize = SignalDatabase.attachments.getRemainingRestorableAttachmentSize()
if (remainingAttachmentSize == 0L) {
Log.d(TAG, "Media restore complete: there are no remaining restorable attachments.")
SignalStore.backup.totalRestorableAttachmentSize = 0
SignalStore.backup.restoreState = RestoreState.NONE
} else if (runAttempt == 0) {
Log.w(TAG, "Still have remaining data to restore, will retry before checking job queues, queue: ${parameters.queue} estimated remaining: $remainingAttachmentSize")
return Result.retry(15.seconds.inWholeMilliseconds)