-
Notifications
You must be signed in to change notification settings - Fork 279
Use the new EdgeCurrencyWallet.split method #5924
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
b48ed1a to
04f6255
Compare
| navigation.navigate('edgeTabs', { | ||
| screen: 'walletsTab', | ||
| params: { screen: 'walletList' } | ||
| }) |
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.
Missing try/catch around split call in handleSplit
Medium Severity
The old handleSplit wrapped each split operation in try/catch, calling showError on failure. The new code calls sourceWallet.split(splitItems) with no try/catch at all. If split() throws an exception (e.g. network error, internal failure) rather than returning an error result, it becomes an unhandled promise rejection since useHandler doesn't catch errors. The companion change in SwapProcessingScene correctly has the split() call inside a try/catch. The handleCreate handler in this same file also wraps its core logic in try/catch.
04f6255 to
ad0f6a7
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.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| navigation.navigate('edgeTabs', { | ||
| screen: 'walletsTab', | ||
| params: { screen: 'walletList' } | ||
| }) |
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.
Missing try/catch leaves user stuck on split error
Medium Severity
The old handleSplit wrapped each split attempt in a try/catch, guaranteeing the user was always navigated to the wallet list even on failure. The new version has no try/catch at all. If sourceWallet.split() throws (rather than returning error results), or if account.currencyConfig[item.pluginId] is undefined (optional chaining ?. was also removed), the function exits early and the navigation.navigate call never runs. While usePendingPress catches the rejection and shows the error, the user remains stuck on the edit-name scene with no automatic navigation back.
Additional Locations (1)
ad0f6a7 to
063f6bc
Compare


CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
EdgeApp/edge-core-js#701
Requirements
If you have made any visual changes to the GUI. Make sure you have:
Note
Medium Risk
Touches wallet-splitting logic used during onboarding and swap recovery, so failures could impact wallet creation/selection even though the change is largely an API migration.
Overview
Updates wallet splitting to use the new
EdgeCurrencyWallet.splitmethod instead ofaccount.splitWalletInfo.The create-wallet split flow now batches requested splits from a source wallet and handles per-split success/failure results, and the swap same-address recovery path now creates the needed destination-chain wallet via
fromWallet.splitand uses the returned wallet instance. CHANGELOG notes improved reliability for parallel wallet splits.Written by Cursor Bugbot for commit 063f6bc. This will update automatically on new commits. Configure here.