Skip to content

fix: don't raise the backup failure alert while a Spark exit defers its backup #2172

Backlog

Description

@jvsena42

Problem

An active Spark force transfer (emergency exit) raises the "Data Backup Failure" notification every 10 minutes while the app is open.

During an exit, SparkRepo.exitBackup() returns null, so the SPARK_EXIT upload throws SparkExitBackupDeferred (BackupRepo.kt:729/:732). That exception is only debug-logged (:850), and the category stays required, which is correct: the upload runs once the exit ends.

checkForFailedBackups() (BackupRepo.kt:606-625) counts any category that has been required for more than FAILED_BACKUP_CHECK_TIME (30 min) as failed, with no exemption for a deferred SPARK_EXIT. The exit phases awaitingFunding and needsFunding can last hours to days, so the user sees the backup failure alert (throttled to 10 min) for the rest of the exit, during an emergency flow.

Fix

Record the deferral where SparkExitBackupDeferred is thrown, and skip SPARK_EXIT in checkForFailedBackups() while it holds. Leave required untouched.

iOS had the same gap, introduced by synonymdev/bitkit-ios#1121 and fixed there in 8c400aa (isSparkExitDeferredByExit plus a skip in hasFailedBackups, covered by a BackupForegroundRecoveryTests case).

Reproduce

Unit test in BackupRepoTest:

  • SPARK_EXIT required 31 minutes ago;
  • sparkRepo.exitBackup() returning null (exit active);
  • run the failure check;
  • assert no backup failure notification.

On a device: start a force transfer on regtest and keep the app open for 31 minutes.

Activity

  1. added this to the 3.3.0 milestone on Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions