-
Notifications
You must be signed in to change notification settings - Fork 66
fix: catch esplora panics and return parsing error #863
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
This is exactly the right idea, which is why I'd strongly be in favor of fixing the panics in |
thanks so much for this feedback @tnull ! And thank you for pointing me towards that open issue! I'll hop on there with a comment too. I thought as well about the ideal ultimate solution being it is addressed in (For anyone reviewing this on |
|
I'm happy to merge this while we wait for the fixes to appear upstream. Your call @reez. Depends on how close you think we are to merging the fix directly in the Rust clients. |
|
with https://github.com/bitcoindevkit/bdk_wallet/releases/tag/wallet-2.2.0 released and ffi following on pretty quick with our release I think this going into our 2.2 would make sense. I also just opened a pr on upstream to potentially remove any other panics. I should rebase this and it should be ready |
|
rebased |
thunderbiscuit
left a comment
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.
ACK 58c425b.
Would you mind opening an issue reminding us to fix this up whenever the fixes are merged upstream?
Totally, I was actually thinking about opening up issues for future releases to track what we want to test/implement/track, so I opened one up for 3.0/2.3 #869 (and added this as the first item) |
Description
Saw this crash happen. BDK's Esplora client panics with
.expect()calls during sync operations when encountering chain inconsistencies (like network mismatches). This causes mobile apps to crash immediately instead of handling the error gracefully.This PR adds a panic-catching wrapper around
EsploraClient.sync()andEsploraClient.fullScan()operations.This change is under the idea of libraries should provide errors not crashes, but I'm totally open to feedback.
Notes to the reviewers
Tested a local build with these changes on BDK iOS.
Changelog notice
Checklists
All Submissions:
cargo fmtandcargo clippybefore committingNew Features:
Bugfixes: