Skip to content

bug: a failed scheduled wallet backup reschedules itself #988

Closed

Description

@ovitrif

Refs:

What happened?

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

  1. Run BitkitTests/BackupServiceTests/testAutomaticBackupDoesNotRepeatUnrelatedFailures several times.
  2. 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

  1. added this to the 3.0.0 milestone on Oct 16, 2026
  2. self-assigned this
    on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions