Skip to content

fix: speed up and cancel for qr wallets. cp-7.80.0#30990

Merged
montelaidev merged 4 commits into
mainfrom
fix/qr-speedup-cancel
Jun 3, 2026
Merged

fix: speed up and cancel for qr wallets. cp-7.80.0#30990
montelaidev merged 4 commits into
mainfrom
fix/qr-speedup-cancel

Conversation

@montelaidev

@montelaidev montelaidev commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Description

This PR fixes the speed up and cancel for qr wallets.

Changelog

CHANGELOG entry: fix speedup and cancel for qr wallets.

Related issues

Fixes: #30939

Manual testing steps

Feature: Speed up and cancel transactions for QR hardware wallet accounts

  Background:
    Given a local Ganache network is running with:
      | Command | npx ganache --wallet.mnemonic 'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about' --miner.blockTime 1200 |
    And the Ganache RPC is available at http://localhost:8545
    And Ganache accounts are funded with ETH
    And the MetaMask mobile app is connected to the local Ganache network via custom network configuration
    And a QR hardware wallet (Keystone) account is imported and selected in MetaMask

  Scenario: user speeds up a pending transaction from a QR hardware wallet account
    Given the user has submitted a transaction from their QR hardware wallet account
    And the transaction is in "submitted" status (not yet mined)
    And the user is viewing the transaction details in the transactions list

    When user taps "Speed up" on the pending transaction
    And user confirms the suggested gas fee values in the speed up modal
    Then the QR signing modal is displayed showing a QR code
    And the user scans the QR code with their Keystone hardware device
    And the Keystone device signs the speed-up replacement transaction
    And the user presents the signed result back to MetaMask
    Then the original transaction is replaced with a new transaction with higher gas
    And the speed-up transaction is broadcast to the network
    And the transaction status changes to "submitted" for the replacement transaction

  Scenario: user cancels a pending transaction from a QR hardware wallet account
    Given the user has submitted a transaction from their QR hardware wallet account
    And the transaction is in "submitted" status (not yet mined)
    And the user is viewing the transaction details in the transactions list

    When user taps "Cancel" on the pending transaction
    And user confirms the suggested gas fee values in the cancel modal
    Then the QR signing modal is displayed showing a QR code
    And the user scans the QR code with their Keystone hardware device
    And the Keystone device signs the cancel replacement transaction
    And the user presents the signed result back to MetaMask
    Then a cancel transaction (0 ETH to self with higher gas) is broadcast to the network
    And the original transaction is replaced by the cancel transaction
    And the transaction status changes to "submitted" for the cancel transaction

  Scenario: user rejects the QR signature during speed up
    Given the user has submitted a transaction from their QR hardware wallet account
    And the transaction is in "submitted" status

    When user taps "Speed up" on the pending transaction
    And user confirms the gas fee values in the speed up modal
    And the QR signing modal is displayed
    And user taps "Cancel" on the QR signing modal
    Then the QR signing modal is dismissed
    And no replacement transaction is created
    And the original transaction remains in "submitted" status

Screenshots/Recordings

Before

After

Screen_Recording_20260603_184445_MetaMask.mp4
Screen_Recording_20260603_184658_MetaMask.mp4

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

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

Medium Risk
Changes pending-transaction replacement and gas submission for QR hardware accounts; behavior is aligned with existing Ledger paths and covered by new tests, but mistakes could affect broadcast or user funds timing.

Overview
QR hardware wallets can speed up and cancel pending transactions the same way Ledger accounts do: after gas confirmation, the app opens the QR signing modal instead of calling the transaction controller directly.

QRSigningTransactionModal now accepts optional signMode (speedup / cancel) and gasValues. On open it runs speedUpTransaction or stopTransaction for those modes, and still uses ApprovalController.acceptRequest for normal QR signing. Speed-up/cancel failures show the shared transaction-update error toast; approval failures do not.

The legacy Transactions list and UnifiedTransactionsView (useUnifiedTxActions) branch on QR keyring accounts and navigate with the new params, then close the gas modal without invoking in-app speed-up/cancel. Tests cover modal error handling and both entry points.

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

@montelaidev montelaidev self-assigned this Jun 3, 2026
@montelaidev montelaidev requested a review from a team as a code owner June 3, 2026 09:36
@montelaidev montelaidev added the team-accounts-framework Accounts team label Jun 3, 2026
@github-actions

github-actions Bot commented Jun 3, 2026

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.

@github-actions github-actions Bot added size-M risk:high AI analysis: high risk labels Jun 3, 2026
Comment thread app/components/UI/QRHardware/QRSigningTransactionModal.tsx
Comment thread app/components/UI/Transactions/index.js Outdated

@cursor cursor Bot 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.

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

Fix All in Cursor

❌ 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 cf6a867. Configure here.

Comment thread app/components/UI/QRHardware/QRSigningTransactionModal.tsx
@github-actions github-actions Bot added risk:medium AI analysis: medium risk and removed risk:high AI analysis: high risk labels Jun 3, 2026
@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeAccounts, SmokeConfirmations, SmokeIdentity, SmokeNetworkAbstractions, SmokeNetworkExpansion, SmokeSwap, SmokeStake, SmokeWalletPlatform, SmokeMoney, SmokePerps, SmokeMultiChainAPI, SmokePredictions, SmokeSeedlessOnboarding, SmokeBrowser, SmokeSnaps
  • Selected Performance tags: @PerformanceAccountList, @PerformanceOnboarding, @PerformanceLogin, @PerformanceSwaps, @PerformanceLaunch, @PerformanceAssetLoading, @PerformancePredict, @PerformancePreps
  • Risk Level: high
  • AI Confidence: %
click to see 🤖 AI reasoning details

E2E Test Selection:
Fallback: AI analysis did not complete successfully. Running all tests.

Performance Test Selection:
Fallback: AI analysis did not complete successfully. Running all performance tests.

View GitHub Actions results

@ccharly ccharly 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.

Code LGTM (not tested, but there are recording)

@montelaidev montelaidev enabled auto-merge June 3, 2026 15:21
@Unik0rnMaggie

Copy link
Copy Markdown
Contributor

Tested using android build from here workflow triggered using this branch with the fix.

Fix works for Speed up and Cancel.
The Confirm button is not unresponsive anymore:

Speed.up.QR.wallet.fix.mp4
Cancel.transaction.mp4

@Unik0rnMaggie Unik0rnMaggie added the QA Passed QA testing has been completed and passed label Jun 3, 2026
@ccharly

ccharly commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Not sure why it does not show properly, but SonarCloud is failing because we miss some coverage:

{"status":"ERROR","metricKey":"new_coverage","comparator":"LT","periodIndex":1,"errorThreshold":"80","actualValue":"74.1"}

Given it's an RC blocker, I think we can skip it!

@ccharly ccharly added the skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. label Jun 3, 2026

@vinnyhoward vinnyhoward 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

@montelaidev montelaidev added this pull request to the merge queue Jun 3, 2026
Merged via the queue into main with commit 262ea0e Jun 3, 2026
504 of 512 checks passed
@montelaidev montelaidev deleted the fix/qr-speedup-cancel branch June 3, 2026 16:12
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 3, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.81.0 Issue or pull request that will be included in release 7.81.0 label Jun 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

QA Passed QA testing has been completed and passed release-7.81.0 Issue or pull request that will be included in release 7.81.0 risk:medium AI analysis: medium risk size-M skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. team-accounts-framework Accounts team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: QR wallet: unable to cancel or speed up transaction on Keystone

5 participants