chore(runway): cherry-pick fix: Perps withdraw back-swipe toast cp-7.78.0#30516
Merged
Merged
Conversation
…78.0 (#30504) ## 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 `addTransactionBatch` catch 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 - Detect user-rejected errors before showing the withdrawal-start failure toast. - Keep the existing retry toast behavior for real `addTransactionBatch` failures. - Add regression coverage for user rejection so it does not call `goBack`, build the retry toast, or show the toast. Fixes #30485. <!-- CURSOR_SUMMARY --> --- > [!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 `addTransactionBatch` failures: on rejection, the hook now rethrows without calling `navigation.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. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit c23f2c3. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
Contributor
|
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. |
Contributor
🔍 Smart E2E Test Selection⏭️ Smart E2E selection skipped - PR targets a release branch (release/*) All E2E tests pre-selected. |
|
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.



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 backand 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
failure toast.
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: onrejection, the hook now rethrows without calling
navigation.goBack()or showing the retryable “withdrawalStartFailed” toast.
Adds a regression test covering a
providerErrors.userRejectedRequest()rejection to ensure no backnavigation 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.