You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: a failed scheduled wallet backup reschedules itself #988
A scheduled wallet backup that fails can schedule itself again. BackupService.runBackup writes the wallet backup through persistWalletBackup, which catches any failure and calls markBackupRequired(category: .wallet, schedule: true). That call meant for callers outside the scheduler, such as a USDT payment, also fires for the scheduler's own attempt. Whether the new attempt runs depends on whether the failed job has removed itself from backupJobs yet, so a backup that keeps failing can retry about every 5 seconds.
This came in with #950 and is in RC2. It makes BackupServiceTests.testAutomaticBackupDoesNotRepeatUnrelatedFailures fail on master CI (run: "Fulfilled inverted expectation 'Unrelated failure retried'") since that merge.
No backup is skipped; the wallet backup stays required. The problem is the extra attempts.
Expected behavior
A scheduled wallet backup that fails waits for the next change or the periodic check like the other categories, and an external persistWalletBackup caller still marks the wallet backup required when it fails.
Steps to Reproduce
Run BitkitTests/BackupServiceTests/testAutomaticBackupDoesNotRepeatUnrelatedFailures several times.
Some runs fail with the inverted expectation fulfilled: the failed wallet backup was attempted again.
Additional context
The fix lands in #971: the scheduled path writes through an inner method that does not re-mark the wallet, and persistWalletBackup keeps the re-mark for its external callers. Android is not affected: its scheduled wallet backup calls the upload directly, and only the external persistWalletBackup re-marks.
Activity