Skip to content

chore(runway): cherry-pick fix(perps): clear confirmation on order view unmount cp-7.64.0#25714

Merged
joaoloureirop merged 1 commit into
release/7.64.0from
runway-cherry-pick-7.64.0-1770305270
Feb 5, 2026
Merged

chore(runway): cherry-pick fix(perps): clear confirmation on order view unmount cp-7.64.0#25714
joaoloureirop merged 1 commit into
release/7.64.0from
runway-cherry-pick-7.64.0-1770305270

Conversation

@runway-github
Copy link
Copy Markdown
Contributor

@runway-github runway-github Bot commented Feb 5, 2026

Description

Clear transaction confirmation when user leaves the perps order screen

Changelog

CHANGELOG entry: null

Related issues

Fixes: #25439

Manual testing steps

  • Go to Perps
  • Start a new order
  • Go back to home page
  • Start Send flow
  • Select any token from any EVM network (on non-EVM networks the error
    does not trigger, but the flow is broken)
  • Input amount
  • Select recipient
  • NO error should be shown

Screenshots/Recordings

Before

no visible change

After

no visible change

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the
    app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described
    in the ticket it closes and includes the necessary testing evidence such
    as recordings and or screenshots.

Note

Low Risk
Small UI lifecycle change that only triggers confirmation rejection on screen exit; low risk but could affect any in-flight confirmation flow if unmount happens unexpectedly.

Overview
Ensures any active transaction confirmation is cleared when leaving the Perps order screen by replacing useClearConfirmationOnBackSwipe with an explicit unmount cleanup that calls useConfirmActions().onReject(undefined, true).

This prevents stale confirmation state from leaking into later flows (e.g., Send) after navigating away from Perps order creation.

Written by Cursor Bugbot for commit ef82b75. This will update automatically on new commits. Configure here.


Co-authored-by: Cursor cursoragent@cursor.com d270ce5

…ew unmount cp-7.64.0 (#25708)

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

Clear transaction confirmation when user leaves the perps order screen

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: null

## **Related issues**

Fixes: #25439
 
## **Manual testing steps**

- Go to Perps
- Start a new order
- Go back to home page
- Start Send flow
- Select any token from any EVM network (on non-EVM networks the error
does not trigger, but the flow is broken)
- Input amount
- Select recipient
- NO error should be shown

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->
no visible change

### **After**

<!-- [screenshots/recordings] -->
no visible change

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Touches shared confirmation state by force-rejecting on unmount; a
mistake here could prematurely dismiss legitimate confirmations or
change navigation/UX around confirmations.
> 
> **Overview**
> Clears any active confirmations when the Perps order screen is left by
replacing `useClearConfirmationOnBackSwipe()` with an explicit unmount
cleanup that calls `useConfirmActions().onReject(undefined, true)`.
> 
> This prevents stale confirmation state from leaking into other flows
(e.g., Send) after backing out of Perps.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
616455e. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
@runway-github runway-github Bot requested a review from a team as a code owner February 5, 2026 15:28
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 5, 2026

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.

@metamaskbot metamaskbot added the team-bots Bot team (for MetaMask Bot, Runway Bot, etc.) label Feb 5, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 5, 2026

🔍 Smart E2E Test Selection

⏭️ Smart E2E selection skipped - base branch is not main (base: release/7.64.0)

All E2E tests pre-selected.

View GitHub Actions results

@github-actions github-actions Bot added the size-S label Feb 5, 2026
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

},
// eslint-disable-next-line react-hooks/exhaustive-deps
[],
);
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.

Stale closure captures outdated onReject callback on unmount

Medium Severity

The useEffect cleanup captures onReject at mount time with an empty dependency array, but onReject from useConfirmActions depends on values like approvalRequest?.id that can change during the component lifecycle. If the approval request changes (e.g., user starts an order creating a new approval), the cleanup will call a stale onReject that may reference outdated or undefined approval state, causing the confirmation to not be properly cleared. The original useClearConfirmationOnBackSwipe hook correctly included onReject in its dependency arrays. A ref pattern would preserve the latest callback while maintaining the unmount-only behavior.

Fix in Cursor Fix in Web

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Feb 5, 2026

@joaoloureirop joaoloureirop enabled auto-merge (squash) February 5, 2026 16:46
@joaoloureirop joaoloureirop merged commit 6fef301 into release/7.64.0 Feb 5, 2026
372 of 381 checks passed
@joaoloureirop joaoloureirop deleted the runway-cherry-pick-7.64.0-1770305270 branch February 5, 2026 18:31
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 5, 2026
@metamaskbot metamaskbot added the release-7.64.0 Issue or pull request that will be included in release 7.64.0 label Feb 6, 2026
@metamaskbot
Copy link
Copy Markdown
Collaborator

No release label on PR. Adding release label release-7.64.0 on PR, as PR was cherry-picked in branch 7.64.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.64.0 Issue or pull request that will be included in release 7.64.0 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.

3 participants