Skip to content

bug: app status turns red and sync retries start after a wallet sync is cancelled #1408

Closed

Description

@ovitrif

What happened?

When the job running a wallet sync is cancelled, for example when the app is closed while a pull to refresh is still syncing, the cancellation is recorded as the last sync error. Home and App Status then show the node and Electrum as failing, and the 15 s sync retry loop starts (Retrying sync after failure in the app log) until a later sync succeeds. The log has no error line before the first retry, because cancellations are not logged as errors.

A sync requested while the cancelled one held the sync lock is not run when the cancelled sync ends; only the retry loop's next attempt picks it up.

Expected behavior

A cancelled sync is not a sync error. The app status stays as it was, no retry loop starts, and a sync requested while the cancelled one ran still runs.

Steps to Reproduce

From the manual test of #1392, on an Android emulator:

  1. Home, pull to refresh.
  2. Turn Wi-Fi and mobile data off to hold the sync open.
  3. Press Android back while the refresh spins.
  4. Turn the network on and reopen the app.
  5. The header shows a red warning icon and Retrying sync after failure appears in the app log 15 s later. A red icon while offline is expected, so judge it once the network is back.

Logs / Screenshots / Recordings

Retrying sync after failure also appears in the logs of several demo runs on Android emulators on 25 and 26 Sep 2026. Those logs do not show what started the retry, so that a cancelled sync did is an inference from the code (only a recorded cancellation starts the retry loop without an error line before it).

Bitkit Version

2.5.0 (190) dev for the demo run logs; not recorded for the reproduction.

Device / OS

Android emulator, API 36.1.

Reproducibility

Always

Additional context

  • Regtest, emulator only; no report from a physical device or from mainnet.
  • Reproduced twice on the unfixed build. The emulator's network throttling did not lengthen the sync (about 1-2 s), so the network was turned off to hold it open. That toggle could itself fail a sync with a network error, so the cancellation is separated from it by comparing with the fixed build, which shows no retry and no icon.
  • Lightning or on-chain: the wallet sync is LightningRepo.sync(); the status comes from HealthRepo reading lastSyncError.
  • iOS has no lastSyncError or sync retry loop, so no twin issue.

Activity

  1. added this to the 2.6.0 milestone on Oct 1, 2026
  2. self-assigned this
    on Oct 1, 2026
  3. added theissue type on Oct 1, 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

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions