Skip to content

chore(runway): cherry-pick fix: Perps withdraw back-swipe toast cp-7.78.0#30516

Merged
chloeYue merged 1 commit into
release/7.78.0from
runway-cherry-pick-7.78.0-1779362425
May 21, 2026
Merged

chore(runway): cherry-pick fix: Perps withdraw back-swipe toast cp-7.78.0#30516
chloeYue merged 1 commit into
release/7.78.0from
runway-cherry-pick-7.78.0-1779362425

Conversation

@runway-github

@runway-github runway-github Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor

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.


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.

Reviewed by Cursor Bugbot for commit
c23f2c3. Bugbot is set up for automated
code reviews on this repo. Configure
here.

[b76275a](https://github.com/MetaMask/metamask-mobile/commit/b76275a34177bbe6cfcb0885498e199ca3aa3548)

…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 -->
@runway-github runway-github Bot requested a review from a team as a code owner May 21, 2026 11:20
@github-actions

Copy link
Copy Markdown
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.

@metamaskbotv2 metamaskbotv2 Bot added the team-bots Bot team (for MetaMask Bot, Runway Bot, etc.) label May 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

⏭️ Smart E2E selection skipped - PR targets a release branch (release/*)

All E2E tests pre-selected.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

@chloeYue chloeYue left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chloeYue chloeYue merged commit 491e502 into release/7.78.0 May 21, 2026
204 of 206 checks passed
@chloeYue chloeYue deleted the runway-cherry-pick-7.78.0-1779362425 branch May 21, 2026 13:04
@github-actions github-actions Bot locked and limited conversation to collaborators May 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size-S team-bots Bot team (for MetaMask Bot, Runway Bot, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants