fix: handle Perps withdraw batch initialization errors cp-7.78.0#30299
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
b4fe8bb to
2c8fd60
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #30299 +/- ##
===========================================
- Coverage 81.98% 47.38% -34.60%
===========================================
Files 5447 5443 -4
Lines 145537 145287 -250
Branches 33248 33210 -38
===========================================
- Hits 119312 68847 -50465
- Misses 18094 70088 +51994
+ Partials 8131 6352 -1779 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
6aee337 to
6911b55
Compare
Signed-off-by: dan437 <80175477+dan437@users.noreply.github.com>
1bd38c3 to
ec6ca72
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ec6ca72. Configure here.
Signed-off-by: dan437 <80175477+dan437@users.noreply.github.com>
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Tag selection rationale:
The changes are well-scoped to Perps withdrawal error handling and don't touch core infrastructure, Engine, or other unrelated flows. Performance Test Selection: |
|




Description
Fixes a Perps Withdraw loading state where users could get stuck on the confirmation skeleton if transaction batch initialization failed before an approval request was created.
The withdraw flow intentionally navigates to Confirmations early and shows a skeleton loader while the transaction batch is created. This PR adds the same failure escape hatch used by similar mobile flows: if
addTransactionBatchfails, the app navigates back from the confirmation loader and shows the existing withdrawal failed toast.Changelog
CHANGELOG entry: Fixed a bug that caused Perps Withdraw to stay stuck on a loading screen when withdrawal initialization failed
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/CONF-1392
Manual testing steps
Screenshots/Recordings
Before
Users could remain stuck on the confirmation skeleton loader.
After
The app navigates back and shows the withdrawal failed toast.
Pre-merge author checklist
Performance checks (if applicable)
Pre-merge reviewer checklist
Note
Medium Risk
Changes Perps withdraw confirmation flow to handle
addTransactionBatchfailures by navigating back and showing a retry action, which affects user navigation and error handling paths. Risk is moderate due to potential edge cases around retry loops and toast/navigation state.Overview
Prevents Perps withdraw from getting stuck on the confirmation skeleton by catching
addTransactionBatchfailures inusePerpsWithdrawConfirmation, navigating back, and showing a new retryablewithdrawalStartFailedtoast that re-attempts initialization.Adds the
withdrawalStartFailed(onRetry)toast option (styled as an error with a "Try again" link) plus new i18n strings, and updates/extends unit tests and mocks to cover the failure + retry behavior and error normalization.Reviewed by Cursor Bugbot for commit a7ae72a. Bugbot is set up for automated code reviews on this repo. Configure here.