fix: Perps withdraw back-swipe toast cp-7.78.0#30504
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. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Impact:
No other areas are affected. The containsUserRejectedError utility is already used elsewhere (spam.ts) and is not being modified. The change is low-risk but warrants running Perps-related tests to validate the user rejection flow works correctly. Performance Test Selection: |
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #30504 +/- ##
==========================================
- Coverage 82.13% 82.13% -0.01%
==========================================
Files 5488 5488
Lines 147743 147756 +13
Branches 33969 33975 +6
==========================================
+ Hits 121353 121363 +10
+ Misses 18084 18083 -1
- Partials 8306 8310 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|



Summary
Fixes the Perps withdraw confirmation flow so user-initiated confirmation rejection, including iOS back-swipe, does not show the retryable "withdrawal wasn't started" error toast.
Root Cause
PR #30299 added an
addTransactionBatchcatch path that navigates back and shows the withdrawal-start failure toast for every rejected batch initialization. Back-swiping the confirmation rejects the approval with a user-rejected error, so that normal cancellation path was being treated as a real initialization failure.Changes
addTransactionBatchfailures.goBack, build the retry toast, or show the toast.Fixes #30485.
Note
Low Risk
Low risk: scoped to Perps withdraw error handling and adds a regression test; behavior only changes for user-rejected/cancel paths.
Overview
Prevents Perps withdraw confirmation cancellations (user-rejected errors) from being treated as
addTransactionBatchfailures: on rejection, the hook now rethrows without callingnavigation.goBack()or showing the retryable “withdrawalStartFailed” toast.Adds a regression test covering a
providerErrors.userRejectedRequest()rejection to ensure no back navigation or toast is triggered, while keeping the existing retry-toast behavior for real batch initialization failures.Reviewed by Cursor Bugbot for commit c23f2c3. Bugbot is set up for automated code reviews on this repo. Configure here.