fix: shield change payment token filter current token
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
Changelog
CHANGELOG entry: fix transaction shield change payment token filter current token
Related issues
Fixes:
Manual testing steps
- Subscribe to shield with mUSD
- Go to shield settings page
- mUSD should not be available as an option for changing payment token
Screenshots/Recordings
Before
After
Pre-merge author checklist
- [x] I've followed MetaMask Contributor Docs and MetaMask Extension Coding Standards.
- [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 format if applicable
- [x] I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
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
availableTokenBalancesWithoutCurrentTokento exclude the current crypto token by comparingtoken.addresswithpaymentMethod.crypto.tokenAddress(case-insensitive) alongsidechainId.- Temporarily extend
SubscriptionCryptoPaymentMethodtype to includecrypto.tokenAddressuntil controller typings are updated.Written by Cursor Bugbot for commit 661473a792ecad2c8a222edfcf18d40d47a537c0. This will update automatically on new commits. Configure here.
✨ Files requiring CODEOWNER review ✨
🔐 @MetaMask/web3auth (1 files, +5 -2)
- 📁 ui/
- 📁 pages/
- 📁 settings/
- 📁 transaction-shield-tab/
- 📄
payment-method-row.tsx+5 -2
- 📄
- 📁 transaction-shield-tab/
- 📁 settings/
- 📁 pages/
Builds ready [661473a]
- builds: chrome, firefox
- builds (beta): chrome, firefox
- builds (flask): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- bundle size: Bundle Size Stats
- user-actions-benchmark: User Actions Stats
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
UI Startup Metrics (1292 ± 112 ms)
| Platform | BuildType | Page | Metric | Mean (ms) | Min (ms) | Max (ms) | Std Dev (ms) | P 75 (ms) | P 95 (ms) |
|---|---|---|---|---|---|---|---|---|---|
| Chrome | Browserify | Standard Home | uiStartup | 1292 | 1065 | 1634 | 112 | 1361 | 1477 |
| load | 1048 | 851 | 1379 | 98 | 1114 | 1224 | |||
| domContentLoaded | 1041 | 845 | 1370 | 98 | 1105 | 1217 | |||
| domInteractive | 28 | 15 | 102 | 21 | 24 | 92 | |||
| firstPaint | 551 | 92 | 1378 | 414 | 1037 | 1160 | |||
| backgroundConnect | 217 | 196 | 253 | 13 | 221 | 246 | |||
| firstReactRender | 44 | 30 | 86 | 11 | 48 | 66 | |||
| getState | 42 | 17 | 143 | 22 | 48 | 86 | |||
| initialActions | 1 | 0 | 4 | 1 | 1 | 2 | |||
| loadScripts | 832 | 652 | 1162 | 94 | 887 | 1007 | |||
| setupStore | 12 | 7 | 28 | 5 | 15 | 21 | |||
| numNetworkReqs | 13 | 6 | 80 | 19 | 6 | 72 | |||
| Browserify | Power User Home | uiStartup | 1919 | 1597 | 2579 | 164 | 1987 | 2213 | |
| load | 1092 | 894 | 1705 | 138 | 1186 | 1315 | |||
| domContentLoaded | 1083 | 885 | 1688 | 137 | 1172 | 1305 | |||
| domInteractive | 31 | 17 | 122 | 24 | 29 | 97 | |||
| firstPaint | 624 | 101 | 1704 | 460 | 1102 | 1304 | |||
| backgroundConnect | 246 | 200 | 571 | 86 | 230 | 523 | |||
| firstReactRender | 48 | 38 | 87 | 6 | 50 | 61 | |||
| getState | 193 | 144 | 717 | 75 | 197 | 229 | |||
| initialActions | 1 | 0 | 3 | 1 | 1 | 2 | |||
| loadScripts | 871 | 693 | 1464 | 135 | 962 | 1095 | |||
| setupStore | 16 | 6 | 40 | 7 | 15 | 35 | |||
| numNetworkReqs | 73 | 58 | 238 | 29 | 67 | 132 | |||
| Webpack | Standard Home | uiStartup | 830 | 678 | 1238 | 97 | 874 | 1013 | |
| load | 673 | 576 | 1041 | 86 | 723 | 812 | |||
| domContentLoaded | 667 | 569 | 1034 | 86 | 718 | 807 | |||
| domInteractive | 26 | 15 | 98 | 17 | 24 | 74 | |||
| firstPaint | 245 | 84 | 796 | 188 | 215 | 770 | |||
| backgroundConnect | 13 | 6 | 82 | 12 | 13 | 29 | |||
| firstReactRender | 52 | 32 | 218 | 31 | 54 | 121 | |||
| getState | 28 | 14 | 74 | 12 | 39 | 47 | |||
| initialActions | 1 | 0 | 4 | 1 | 1 | 2 | |||
| loadScripts | 664 | 567 | 1031 | 85 | 715 | 805 | |||
| setupStore | 11 | 6 | 36 | 5 | 13 | 20 | |||
| numNetworkReqs | 14 | 6 | 83 | 20 | 6 | 74 | |||
| Webpack | Power User Home | uiStartup | 1431 | 1079 | 1869 | 194 | 1593 | 1766 | |
| load | 737 | 597 | 1074 | 110 | 836 | 928 | |||
| domContentLoaded | 729 | 592 | 1060 | 109 | 828 | 920 | |||
| domInteractive | 32 | 17 | 162 | 29 | 26 | 112 | |||
| firstPaint | 292 | 91 | 1087 | 236 | 257 | 891 | |||
| backgroundConnect | 103 | 8 | 671 | 199 | 45 | 635 | |||
| firstReactRender | 49 | 41 | 69 | 4 | 51 | 58 | |||
| getState | 183 | 144 | 324 | 32 | 193 | 247 | |||
| initialActions | 1 | 0 | 2 | 0 | 1 | 1 | |||
| loadScripts | 726 | 589 | 1051 | 108 | 825 | 918 | |||
| setupStore | 15 | 7 | 48 | 8 | 15 | 37 | |||
| numNetworkReqs | 71 | 58 | 223 | 25 | 66 | 129 | |||
| Firefox | Browserify | Standard Home | uiStartup | 1320 | 1053 | 1786 | 158 | 1420 | 1620 |
| load | 1062 | 891 | 1311 | 95 | 1129 | 1247 | |||
| domContentLoaded | 1061 | 891 | 1310 | 95 | 1128 | 1246 | |||
| domInteractive | 63 | 30 | 206 | 37 | 84 | 135 | |||
| firstPaint | - | - | - | - | - | - | |||
| backgroundConnect | 48 | 22 | 215 | 37 | 53 | 153 | |||
| firstReactRender | 37 | 31 | 65 | 6 | 38 | 49 | |||
| getState | 15 | 7 | 139 | 20 | 12 | 46 | |||
| initialActions | 1 | 0 | 2 | 1 | 1 | 2 | |||
| loadScripts | 1033 | 877 | 1248 | 86 | 1098 | 1200 | |||
| setupStore | 12 | 6 | 48 | 8 | 11 | 34 | |||
| numNetworkReqs | 15 | 6 | 80 | 21 | 8 | 77 | |||
| Browserify | Power User Home | uiStartup | 2582 | 1646 | 3948 | 551 | 3023 | 3433 | |
| load | 1586 | 995 | 2699 | 510 | 2077 | 2421 | |||
| domContentLoaded | 1585 | 995 | 2699 | 510 | 2076 | 2420 | |||
| domInteractive | 183 | 32 | 1142 | 290 | 103 | 975 | |||
| firstPaint | - | - | - | - | - | - | |||
| backgroundConnect | 184 | 26 | 1194 | 205 | 218 | 440 | |||
| firstReactRender | 55 | 38 | 106 | 11 | 59 | 74 | |||
| getState | 134 | 67 | 513 | 59 | 150 | 231 | |||
| initialActions | 3 | 1 | 34 | 4 | 2 | 7 | |||
| loadScripts | 1492 | 977 | 2680 | 475 | 1922 | 2327 | |||
| setupStore | 50 | 5 | 1038 | 118 | 34 | 222 | |||
| numNetworkReqs | 75 | 58 | 137 | 24 | 67 | 131 | |||
| Webpack | Standard Home | uiStartup | 1599 | 1287 | 2274 | 189 | 1698 | 1996 | |
| load | 1310 | 1092 | 1894 | 129 | 1372 | 1538 | |||
| domContentLoaded | 1310 | 1092 | 1894 | 129 | 1371 | 1538 | |||
| domInteractive | 76 | 28 | 228 | 40 | 109 | 131 | |||
| firstPaint | - | - | - | - | - | - | |||
| backgroundConnect | 58 | 17 | 205 | 39 | 57 | 151 | |||
| firstReactRender | 44 | 32 | 98 | 13 | 46 | 84 | |||
| getState | 14 | 7 | 72 | 11 | 14 | 42 | |||
| initialActions | 1 | 0 | 3 | 1 | 2 | 2 | |||
| loadScripts | 1279 | 1076 | 1864 | 121 | 1336 | 1474 | |||
| setupStore | 22 | 7 | 194 | 31 | 16 | 107 | |||
| numNetworkReqs | 15 | 6 | 82 | 21 | 8 | 75 | |||
| Webpack | Power User Home | uiStartup | 2846 | 1815 | 3847 | 561 | 3303 | 3685 | |
| load | 1924 | 1140 | 2807 | 535 | 2394 | 2695 | |||
| domContentLoaded | 1924 | 1140 | 2807 | 535 | 2394 | 2694 | |||
| domInteractive | 241 | 29 | 1025 | 352 | 160 | 984 | |||
| firstPaint | - | - | - | - | - | - | |||
| backgroundConnect | 188 | 25 | 1109 | 240 | 210 | 966 | |||
| firstReactRender | 59 | 37 | 199 | 19 | 62 | 78 | |||
| getState | 133 | 83 | 255 | 44 | 162 | 238 | |||
| initialActions | 3 | 1 | 39 | 5 | 2 | 6 | |||
| loadScripts | 1835 | 1124 | 2782 | 515 | 2273 | 2666 | |||
| setupStore | 60 | 5 | 1062 | 131 | 48 | 318 | |||
| numNetworkReqs | 71 | 46 | 130 | 23 | 67 | 121 |
📊 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%)