metamask-extension icon indicating copy to clipboard operation
metamask-extension copied to clipboard

fix: shield change payment token filter current token

Open tuna1207 opened this issue 4 weeks ago • 2 comments

Description

In shield settings page with crypto payment method we allow changing payment token which filter out current payment token but was using symbol to filter and got case mismatch, this PR use token address to filter instead

Open in GitHub Codespaces

Changelog

CHANGELOG entry: fix transaction shield change payment token filter current token

Related issues

Fixes:

Manual testing steps

  1. Subscribe to shield with mUSD
  2. Go to shield settings page
  3. mUSD should not be available as an option for changing payment token

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • [x] 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] Use token address (case-insensitive) to filter out the currently used crypto token when changing Shield payment method.

  • Shield Settings (UI)
    • Update availableTokenBalancesWithoutCurrentToken to exclude the current crypto token by comparing token.address with paymentMethod.crypto.tokenAddress (case-insensitive) alongside chainId.
    • Temporarily extend SubscriptionCryptoPaymentMethod type to include crypto.tokenAddress until controller typings are updated.

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

tuna1207 avatar Dec 10 '25 09:12 tuna1207

✨ Files requiring CODEOWNER review ✨

🔐 @MetaMask/web3auth (1 files, +5 -2)
  • 📁 ui/
    • 📁 pages/
      • 📁 settings/
        • 📁 transaction-shield-tab/
          • 📄 payment-method-row.tsx +5 -2

metamaskbot avatar Dec 10 '25 09:12 metamaskbot

Builds ready [661473a]
UI Startup Metrics (1292 ± 112 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup12921065163411213611477
load104885113799811141224
domContentLoaded104184513709811051217
domInteractive2815102212492
firstPaint55192137841410371160
backgroundConnect21719625313221246
firstReactRender443086114866
getState4217143224886
initialActions104112
loadScripts8326521162948871007
setupStore1272851521
numNetworkReqs1368019672
BrowserifyPower User HomeuiStartup19191597257916419872213
load1092894170513811861315
domContentLoaded1083885168813711721305
domInteractive3117122242997
firstPaint624101170446011021304
backgroundConnect24620057186230523
firstReactRender48388765061
getState19314471775197229
initialActions103112
loadScripts87169314641359621095
setupStore1664071535
numNetworkReqs73582382967132
WebpackStandard HomeuiStartup8306781238978741013
load673576104186723812
domContentLoaded667569103486718807
domInteractive261598172474
firstPaint24584796188215770
backgroundConnect13682121329
firstReactRender52322183154121
getState281474123947
initialActions104112
loadScripts664567103185715805
setupStore1163651320
numNetworkReqs1468320674
WebpackPower User HomeuiStartup14311079186919415931766
load7375971074110836928
domContentLoaded7295921060109828920
domInteractive32171622926112
firstPaint292911087236257891
backgroundConnect103867119945635
firstReactRender49416945158
getState18314432432193247
initialActions102011
loadScripts7265891051108825918
setupStore1574881537
numNetworkReqs71582232566129
FirefoxBrowserifyStandard HomeuiStartup13201053178615814201620
load106289113119511291247
domContentLoaded106189113109511281246
domInteractive63302063784135
firstPaint------
backgroundConnect48222153753153
firstReactRender37316563849
getState157139201246
initialActions102112
loadScripts103387712488610981200
setupStore1264881134
numNetworkReqs1568021877
BrowserifyPower User HomeuiStartup25821646394855130233433
load1586995269951020772421
domContentLoaded1585995269951020762420
domInteractive183321142290103975
firstPaint------
backgroundConnect184261194205218440
firstReactRender5538106115974
getState1346751359150231
initialActions3134427
loadScripts1492977268047519222327
setupStore505103811834222
numNetworkReqs75581372467131
WebpackStandard HomeuiStartup15991287227418916981996
load13101092189412913721538
domContentLoaded13101092189412913711538
domInteractive762822840109131
firstPaint------
backgroundConnect58172053957151
firstReactRender443298134684
getState14772111442
initialActions103122
loadScripts12791076186412113361474
setupStore2271943116107
numNetworkReqs1568221875
WebpackPower User HomeuiStartup28461815384756133033685
load19241140280753523942695
domContentLoaded19241140280753523942694
domInteractive241291025352160984
firstPaint------
backgroundConnect188251109240210966
firstReactRender5937199196278
getState1338325544162238
initialActions3139526
loadScripts18351124278251522732666
setupStore605106213148318
numNetworkReqs71461302367121
📊 Page Load Benchmark Results

Current Commit: 661473a | Date: 12/10/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 993ms (±39ms) 🟢 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 687ms (±35ms) 🟢 | historical mean value: 727ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 77ms (±11ms) 🟢 | historical mean value: 82ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 993ms 39ms 961ms 1.27s 1.02s 1.27s
domContentLoaded 687ms 35ms 660ms 943ms 709ms 943ms
firstPaint 77ms 11ms 60ms 172ms 88ms 172ms
firstContentfulPaint 77ms 11ms 60ms 172ms 88ms 172ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: -2.01 KiB (-0.03%)
  • common: 20 Bytes (0%)

metamaskbot avatar Dec 10 '25 09:12 metamaskbot