Skip to content

Conversation

@jvsena42
Copy link
Member

Fixes #652

This PR fixes the "Bitkit keeps stopping" crash that occurs after wallet restoration when LDK's transaction sync encounters an unconfirmed channel funding transaction on Electrum.

Description

  1. Adds proper error handling in LightningRepo.sync() using runCatching to catch and propagate sync failures
  2. Shows a user-friendly toast notification in WalletViewModel when sync timeout occurs instead of silently ignoring it
  3. Adds localized string resources for the error message

The root cause was that after wallet restoration, LDK couldn't find a channel's funding transaction on Electrum, causing an infinite retry loop until timeout. The exception was not properly handled, leaving the app appearing frozen and eventually triggering a crash.

Preview

QA Notes

1. Verify sync error handling

  1. Restore a wallet that has Lightning channels
  2. If sync fails with timeout, verify a toast notification appears with "Lightning Sync Error"
  3. Verify the app remains responsive and doesn't crash

2. Verify normal sync still works

  1. Open the app with an existing wallet
  2. Pull to refresh on the home screen
  3. Verify sync completes successfully without errors

3. Regression tests

  • Send a Lightning payment
  • Receive a Lightning payment
  • Open Lightning Connections screen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Bitkit keeps stopping Error

2 participants