Skip to content

fix: fixes ledger decline button not clearing#40501

Merged
ghgoodreau merged 1 commit intomainfrom
SWAPS-4174-ledger-decline-buttonfix
Mar 4, 2026
Merged

fix: fixes ledger decline button not clearing#40501
ghgoodreau merged 1 commit intomainfrom
SWAPS-4174-ledger-decline-buttonfix

Conversation

@ghgoodreau
Copy link
Contributor

@ghgoodreau ghgoodreau commented Feb 27, 2026

Description

Fixes a bug where the ledger transaction decline label was not clearing when refetching quotes, blocking new quotes from being executed.

Open in GitHub Codespaces

Changelog

CHANGELOG entry: fixed a bug when cancelling a hardware wallet tx that would cause swaps button to not display

Related issues

Fixes: #40277

Manual testing steps

  1. Go to execute a swap with a ledger HW
  2. cancel the tx
  3. refetch a quote
  4. you should be able to swap

Screenshots/Recordings

Before

After

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-state fix in the bridge CTA flow; low risk and covered by a new test, though it affects gating of quote refresh/swap eligibility.

Overview
Fixes a bridge refresh edge case where a previously declined hardware-wallet transaction could leave the UI stuck in the declined state.

BridgeCTAButton now clears the bridge.wasTxDeclined flag when the user clicks the secondary "fetch new quotes" link, then triggers onFetchNewQuotes. Adds a regression test asserting the state reset and callback invocation.

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

@github-actions
Copy link
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.

@metamaskbot metamaskbot added the team-swaps-and-bridge Swaps and Bridge team label Feb 27, 2026
@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 27, 2026

✨ Files requiring CODEOWNER review ✨

🔄 @MetaMask/swaps-engineers (2 files, +29 -2)
  • 📁 ui/
    • 📁 pages/
      • 📁 bridge/
        • 📁 prepare/
          • 📄 bridge-cta-button.test.tsx +20 -0
          • 📄 bridge-cta-button.tsx +9 -2

@sonarqubecloud
Copy link

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 27, 2026

Builds ready [7d854d9]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account27826330013282300
total27826330013282300
Confirm Txconfirm_tx6075602661564760986156
total6075602661564760986156
Bridge User Actionsbridge_load_page23218527837264278
bridge_load_asset_picker24217629846284298
bridge_search_token7327207479736747
total1223120612461712301246
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14321189184312114901633
load1211992159410912571398
domContentLoaded1204989158410812521385
domInteractive2817127182474
firstPaint172681185129219334
backgroundConnect21019324912214234
firstReactRender19125052026
initialActions106124
loadScripts1010797138710710581185
setupStore1364761527
numNetworkReqs312291202286
Power User HomeuiStartup20321438978399919092816
load12101071188015912441575
domContentLoaded11931065177314612381543
domInteractive3620191253764
firstPaint194761788181247330
backgroundConnect4522767713822338501
firstReactRender24156992542
initialActions1012113
loadScripts96883315491439821326
setupStore1579091625
numNetworkReqs63371472371104
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2212192263223226
srpButtonToSrpForm97959929999
confirmSrpToPwForm22222302223
pwFormToMetricsScreen16161601616
metricsToWalletReadyScreen17171701717
doneButtonToHomeScreen954594128027512721280
openAccountMenuToAccountListLoaded75607019783330478297833
total88898670909114990039091
Onboarding New WalletcreateWalletToSocialScreen2192182190219219
srpButtonToPwForm1081071081108108
createPwToRecoveryScreen889089
skipBackupToMetricsScreen36343923739
agreeButtonToOnboardingSuccess16151711717
doneButtonToAssetList651491916174799916
total1046880129816511861298
Asset DetailsassetClickToPriceChart72697327373
total72697327373
Solana Asset DetailsassetClickToPriceChart53486465364
total53486465364
Import Srp HomeloginToHomeScreen1981189420616420182061
openAccountMenuAfterLogin45375054850
homeAfterImportWithNewWallet25262175283826227402838
total46244193523038748505230
Send TransactionsopenSendPageFromHome20172532125
selectTokenToSendFormLoaded23192842528
reviewTransactionToConfirmationPage8598498678865867
total89888591311902913
SwapopenSwapPageFromHome1241211293126129
fetchAndDisplaySwapQuotes52904574626778062196267
total54204703638777263406387
🌐 Dapp Page Load Benchmarks

Current Commit: 7d854d9 | Date: 2/27/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±85ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 739ms (±106ms) 🟢 | historical mean value: 731ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 96ms (±174ms) 🟢 | historical mean value: 82ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 85ms 1.02s 1.85s 1.07s 1.85s
domContentLoaded 739ms 106ms 710ms 1.76s 759ms 1.76s
firstPaint 96ms 174ms 60ms 1.83s 92ms 1.83s
firstContentfulPaint 96ms 174ms 60ms 1.83s 92ms 1.83s
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs
  • background: 58 Bytes (0%)
  • ui: 142 Bytes (0%)
  • common: 20 Bytes (0%)

@ghgoodreau ghgoodreau marked this pull request as ready for review March 3, 2026 19:24
@ghgoodreau ghgoodreau requested a review from a team as a code owner March 3, 2026 19:24
@ghgoodreau ghgoodreau added this pull request to the merge queue Mar 3, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 3, 2026
@ghgoodreau ghgoodreau added this pull request to the merge queue Mar 4, 2026
Merged via the queue into main with commit d42a431 Mar 4, 2026
196 of 199 checks passed
@ghgoodreau ghgoodreau deleted the SWAPS-4174-ledger-decline-buttonfix branch March 4, 2026 03:04
@github-actions github-actions bot locked and limited conversation to collaborators Mar 4, 2026
@metamaskbot metamaskbot added the release-13.22.0 Issue or pull request that will be included in release 13.22.0 label Mar 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.22.0 Issue or pull request that will be included in release 13.22.0 size-S team-swaps-and-bridge Swaps and Bridge team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Bridge - When rejecting with hardware wallet device, I get Fetch a new one? message and cannot get out of this loop after fetching new Quotes

4 participants