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
fix: retry a failed wear spark disconnect in the background #2181
On the watch, WalletRepo disconnects the Spark SDK when the app leaves the screen (after 10 s) or the watch locks. If BreezSdk.disconnect() throws, the SDK stays referenced and the next lock, pause, start or wipe tries again. While the app stays in the background or locked, though, nothing retries, so the SDK can keep running until the next foreground or lock change.
Related: when a wipe fails because its disconnect failed, the kept SDK still has its event listener, and its events can write the removed wallet's balance into the error state.
Proposal
Retry a failed disconnect with a bounded backoff while the app stays in the background or locked.
Ignore SDK events while the wallet is not in a connected status (or after a failed wipe).
Done when
Unit tests cover a disconnect that fails, then succeeds on retry while the app stays in the background, and a failed wipe whose events no longer update the state.
Found in review rounds 5–7 of the Wear OS foundation PR. Rare: it needs the SDK's disconnect to throw.
Activity