-
Notifications
You must be signed in to change notification settings - Fork 1
fix: roll back electrum connection on failure #261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
0bc3a7c to
7fa83fc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds robust error handling for Electrum server connections by implementing rollback to the last working configuration on connection failures. Key changes include passing connection protocol (tcp:// or ssl://) to ldk-node, validating connections before saving configuration, and keeping app status synchronized during connection changes. The PR also improves UI usability by making the keyboard dismissible via scroll and tap gestures.
- Adds connection validation and rollback mechanism when Electrum server changes fail
- Updates protocol handling to pass full URLs with tcp:// or ssl:// prefixes to ldk-node
- Synchronizes wallet state after connection changes to keep UI status accurate
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| ElectrumSettingsScreen.swift | Adds keyboard dismissal functionality and wallet state synchronization after connection changes |
| WalletViewModel.swift | Updates to use fullUrl property and adds lifecycle state synchronization in syncNodeStatus |
| SettingsViewModel.swift | Replaces protocol prefix concatenation with fullUrl property usage |
| SettingsViewModel+Rgs.swift | Updates RGS configuration to use fullUrl property |
| SettingsViewModel+Electrum.swift | Implements connection validation and rollback logic, adds protocol prefix parsing for QR codes |
| LightningService.swift | Adds error handling with recovery via restartWithPreviousConfig method |
| ElectrumConfigService.swift | Updates default server parsing to handle protocol prefixes |
| ElectrumServer.swift | Adds fullUrl computed property for protocol-prefixed URLs |
| Env.swift | Updates default Electrum server URLs to include protocol prefixes |
|
@piotr-iohk Can I merge or do I need to rerun e2e tests first? |
Good to merge, tests are updated and green. |
Description
Linked Issues/Tasks
Closes #256 #257
Screenshot / Video
Simulator.Screen.Recording.-.iPhone.17.-.2025-12-03.at.12.21.50.mov