Improve unstake scene error handling#6098
Closed
j0ntz wants to merge 1 commit into
Closed
Conversation
Replace the popup error alert and generic "unknown error occurred" on the StakeModify scene with the real error surfaced in the existing on-scene error field. When the failure is insufficient funds during an unstake, show a clear message that the wallet needs a native-asset balance to cover the network fee.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
Author
📸🩹 Test evidence (hack-forced)
🩹 HACK-FORCED: unstake insufficient funds Captured by the agent's in-app test run (build-and-test). |
6 tasks
Contributor
Author
|
Superseded by #6105, which consolidates this and 11 other small GUI task branches into one PR/branch per the umbrella task's instructions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
none
Requirements
If you have made any visual changes to the GUI. Make sure you have:
Description
Asana: https://app.asana.com/1/9976422036640/project/1200382638405084/task/1211086099095860
Improves the unstake error experience on the StakeModify scene (repro: unstake an asset with no native balance to pay the network fee, e.g. LTC with no LTC).
Per the task and RJ's review note ("do not show the error alert at this scene since we already have an error field; fish out and properly display the error correctly if possible") and Michael's note ("give a message stating that the wallet needs balance to unstake"):
showErrorpopup (the scary red alert) from the quote-fetch and approve error paths. The scene already has an on-scene error field (ErrorTile); it is now the single error surface.getDisplayErrorMessagehelper (src/util/stakeErrorUtils.ts).InsufficientFundsErrorduring an unstake, the error field now shows a clear message ("This wallet needs a<currency>balance to cover the network fee for unstaking.") instead of a bare "Insufficient Funds".Testing
tsc --noEmit, eslint, and the full jest suite pass (verify-repo.sh).src/__tests__/stakeErrorUtils.test.ts(4 cases) covers the fish-out logic: real message passthrough, edge-core-js error subclasses, empty-message fallback, and non-Error fallback.ErrorTilewith the new copy and no popup. See the attached 🩹 hack-forced screenshot. The hack was reverted (clean tree); the string-selection and no-popup logic are also covered by the unit test.