fix: dismiss import nft modal on timeout
Description
The import NFT modal does not dismiss on Firefox/Sepolia. Added a timeout to automatically close the modal if the call to get details hangs.
Changelog
CHANGELOG entry: Fixes hanging import nft modal on Sepolia/firefox
Related issues
Fixes: https://github.com/MetaMask/metamask-extension/issues/29633
Manual testing steps
- Go to this page...
Screenshots/Recordings
Before
After
Pre-merge author checklist
- [ ] I've followed MetaMask Contributor Docs and MetaMask Extension Coding Standards.
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using JSDoc format if applicable
- [ ] I’ve applied the right labels on the PR (see labeling guidelines). 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.
[!NOTE] Adds a 3-second timeout around fetching NFT token standard/details in the Import NFTs modal to prevent hanging.
- Frontend
- Import NFTs Modal (
ui/components/multichain/import-nfts-modal/import-nfts-modal.js):
- Wrap
getTokenStandardAndDetailswithPromise.raceto enforce a 3s timeout; fall back to{}on error/timeout.- No changes to import flow; metrics still tracked using resolved
tokenDetailswhen available.Written by Cursor Bugbot for commit bf062eec1ae3c7a4b635ffd19fefabd4bb05abd7. This will update automatically on new commits. Configure here.
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.
✨ Files requiring CODEOWNER review ✨
👨🔧 @MetaMask/core-extension-ux (1 files, +9 -5)
- 📁 ui/
- 📁 components/
- 📁 multichain/
- 📁 import-nfts-modal/
- 📄
import-nfts-modal.js+9 -5
- 📄
- 📁 import-nfts-modal/
- 📁 multichain/
- 📁 components/
Builds ready [bf062ee]
- 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 (1252 ± 102 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 | 1252 | 1029 | 1485 | 102 | 1325 | 1397 |
| load | 1032 | 867 | 1226 | 83 | 1080 | 1195 | |||
| domContentLoaded | 1026 | 862 | 1217 | 82 | 1072 | 1188 | |||
| domInteractive | 25 | 15 | 100 | 19 | 21 | 79 | |||
| firstPaint | 529 | 142 | 1233 | 408 | 1031 | 1170 | |||
| backgroundConnect | 215 | 197 | 290 | 14 | 220 | 240 | |||
| firstReactRender | 47 | 31 | 80 | 11 | 55 | 70 | |||
| getState | 35 | 18 | 70 | 11 | 42 | 57 | |||
| initialActions | 1 | 0 | 6 | 1 | 1 | 3 | |||
| loadScripts | 817 | 652 | 1007 | 80 | 858 | 975 | |||
| setupStore | 12 | 6 | 36 | 6 | 14 | 27 | |||
| numNetworkReqs | 13 | 6 | 76 | 19 | 6 | 69 | |||
| Browserify | Power User Home | uiStartup | 1949 | 1552 | 2655 | 169 | 2020 | 2252 | |
| load | 1102 | 896 | 1681 | 142 | 1186 | 1322 | |||
| domContentLoaded | 1093 | 891 | 1671 | 141 | 1179 | 1313 | |||
| domInteractive | 31 | 17 | 124 | 22 | 28 | 91 | |||
| firstPaint | 529 | 99 | 1683 | 420 | 1008 | 1300 | |||
| backgroundConnect | 258 | 197 | 747 | 98 | 244 | 549 | |||
| firstReactRender | 47 | 39 | 76 | 5 | 49 | 59 | |||
| getState | 209 | 150 | 752 | 95 | 215 | 284 | |||
| initialActions | 1 | 0 | 5 | 1 | 1 | 2 | |||
| loadScripts | 874 | 690 | 1427 | 139 | 961 | 1101 | |||
| setupStore | 14 | 6 | 37 | 5 | 14 | 27 | |||
| numNetworkReqs | 70 | 58 | 154 | 18 | 68 | 120 | |||
| Webpack | Standard Home | uiStartup | 821 | 682 | 1150 | 89 | 891 | 982 | |
| load | 667 | 575 | 1007 | 87 | 729 | 825 | |||
| domContentLoaded | 661 | 570 | 995 | 87 | 725 | 819 | |||
| domInteractive | 25 | 15 | 98 | 19 | 22 | 86 | |||
| firstPaint | 254 | 74 | 868 | 192 | 230 | 706 | |||
| backgroundConnect | 11 | 6 | 32 | 6 | 13 | 27 | |||
| firstReactRender | 54 | 33 | 262 | 37 | 55 | 135 | |||
| getState | 28 | 14 | 56 | 11 | 38 | 49 | |||
| initialActions | 1 | 0 | 4 | 1 | 1 | 2 | |||
| loadScripts | 658 | 568 | 989 | 86 | 723 | 811 | |||
| setupStore | 11 | 6 | 30 | 4 | 13 | 19 | |||
| numNetworkReqs | 14 | 6 | 81 | 20 | 6 | 77 | |||
| Webpack | Power User Home | uiStartup | 1501 | 1116 | 2158 | 209 | 1665 | 1833 | |
| load | 770 | 622 | 1250 | 120 | 886 | 958 | |||
| domContentLoaded | 762 | 616 | 1245 | 119 | 878 | 946 | |||
| domInteractive | 34 | 18 | 150 | 28 | 28 | 109 | |||
| firstPaint | 355 | 89 | 1075 | 251 | 643 | 895 | |||
| backgroundConnect | 87 | 7 | 694 | 177 | 55 | 641 | |||
| firstReactRender | 53 | 42 | 86 | 7 | 56 | 66 | |||
| getState | 198 | 143 | 355 | 41 | 209 | 275 | |||
| initialActions | 1 | 0 | 2 | 0 | 1 | 2 | |||
| loadScripts | 758 | 613 | 1235 | 118 | 871 | 942 | |||
| setupStore | 16 | 7 | 51 | 9 | 15 | 37 | |||
| numNetworkReqs | 74 | 57 | 241 | 35 | 65 | 174 | |||
| Firefox | Browserify | Standard Home | uiStartup | 1325 | 1072 | 1951 | 176 | 1399 | 1708 |
| load | 1061 | 902 | 1319 | 90 | 1115 | 1235 | |||
| domContentLoaded | 1061 | 901 | 1319 | 90 | 1115 | 1235 | |||
| domInteractive | 65 | 31 | 212 | 38 | 85 | 139 | |||
| firstPaint | - | - | - | - | - | - | |||
| backgroundConnect | 56 | 22 | 342 | 57 | 60 | 194 | |||
| firstReactRender | 43 | 31 | 497 | 46 | 44 | 58 | |||
| getState | 14 | 7 | 160 | 16 | 14 | 26 | |||
| initialActions | 1 | 0 | 3 | 1 | 2 | 2 | |||
| loadScripts | 1032 | 884 | 1262 | 81 | 1089 | 1190 | |||
| setupStore | 15 | 5 | 199 | 22 | 13 | 52 | |||
| numNetworkReqs | 15 | 6 | 83 | 21 | 8 | 76 | |||
| Browserify | Power User Home | uiStartup | 2663 | 1611 | 3709 | 538 | 3054 | 3409 | |
| load | 1673 | 931 | 2567 | 498 | 2088 | 2501 | |||
| domContentLoaded | 1673 | 931 | 2566 | 497 | 2087 | 2501 | |||
| domInteractive | 159 | 32 | 1071 | 260 | 105 | 949 | |||
| firstPaint | - | - | - | - | - | - | |||
| backgroundConnect | 173 | 27 | 1149 | 209 | 182 | 951 | |||
| firstReactRender | 56 | 35 | 110 | 13 | 61 | 89 | |||
| getState | 130 | 69 | 270 | 42 | 158 | 215 | |||
| initialActions | 3 | 1 | 41 | 6 | 2 | 7 | |||
| loadScripts | 1604 | 916 | 2542 | 476 | 2004 | 2375 | |||
| setupStore | 48 | 4 | 1097 | 119 | 42 | 190 | |||
| numNetworkReqs | 73 | 51 | 139 | 21 | 80 | 118 | |||
| Webpack | Standard Home | uiStartup | 1512 | 1255 | 1980 | 139 | 1546 | 1793 | |
| load | 1253 | 1092 | 1549 | 97 | 1307 | 1420 | |||
| domContentLoaded | 1253 | 1092 | 1549 | 97 | 1306 | 1420 | |||
| domInteractive | 65 | 27 | 157 | 35 | 86 | 130 | |||
| firstPaint | - | - | - | - | - | - | |||
| backgroundConnect | 53 | 19 | 201 | 37 | 55 | 130 | |||
| firstReactRender | 43 | 31 | 103 | 12 | 45 | 78 | |||
| getState | 14 | 6 | 61 | 11 | 15 | 46 | |||
| initialActions | 1 | 0 | 2 | 0 | 2 | 2 | |||
| loadScripts | 1222 | 1078 | 1497 | 87 | 1280 | 1388 | |||
| setupStore | 16 | 5 | 140 | 21 | 12 | 48 | |||
| numNetworkReqs | 15 | 6 | 82 | 21 | 9 | 76 | |||
| Webpack | Power User Home | uiStartup | 2923 | 1902 | 4432 | 583 | 3385 | 3829 | |
| load | 1970 | 1177 | 3298 | 535 | 2406 | 2720 | |||
| domContentLoaded | 1970 | 1177 | 3297 | 535 | 2405 | 2720 | |||
| domInteractive | 222 | 30 | 1112 | 321 | 163 | 989 | |||
| firstPaint | - | - | - | - | - | - | |||
| backgroundConnect | 185 | 31 | 1235 | 222 | 216 | 970 | |||
| firstReactRender | 62 | 43 | 131 | 15 | 65 | 96 | |||
| getState | 143 | 78 | 283 | 55 | 183 | 259 | |||
| initialActions | 3 | 1 | 40 | 5 | 2 | 3 | |||
| loadScripts | 1883 | 1159 | 3097 | 506 | 2333 | 2618 | |||
| setupStore | 58 | 6 | 1042 | 127 | 50 | 300 | |||
| numNetworkReqs | 75 | 52 | 139 | 25 | 68 | 128 |
📊 Page Load Benchmark Results
Current Commit: bf062ee | Date: 12/10/2025
📄 Localhost MetaMask Test Dapp
Samples: 100
Summary
- pageLoadTime-> current mean value: 1.03s (±42ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
- domContentLoaded-> current mean value: 716ms (±39ms) 🟢 | historical mean value: 724ms ⬇️ (historical data)
- firstContentfulPaint-> current mean value: 76ms (±10ms) 🟢 | historical mean value: 78ms ⬇️ (historical data)
📈 Detailed Results
| Metric | Mean | Std Dev | Min | Max | P95 | P99 |
|---|---|---|---|---|---|---|
| pageLoadTime | 1.03s | 42ms | 1.00s | 1.34s | 1.07s | 1.34s |
| domContentLoaded | 716ms | 39ms | 692ms | 1.01s | 746ms | 1.01s |
| firstPaint | 76ms | 10ms | 56ms | 148ms | 88ms | 148ms |
| firstContentfulPaint | 76ms | 10ms | 56ms | 148ms | 88ms | 148ms |
| largestContentfulPaint | 0ms | 0ms | 0ms | 0ms | 0ms | 0ms |
Bundle size diffs [🚀 Bundle size reduced!]
- background: 116 Bytes (0%)
- ui: -2.28 KiB (-0.03%)
- common: -582 Bytes (-0.01%)