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

fix: dismiss import nft modal on timeout

Open sahar-fehri opened this issue 1 month ago • 3 comments

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.

Open in GitHub Codespaces

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

  1. Go to this page...

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] 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 getTokenStandardAndDetails with Promise.race to enforce a 3s timeout; fall back to {} on error/timeout.
      • No changes to import flow; metrics still tracked using resolved tokenDetails when available.

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

sahar-fehri avatar Dec 10 '25 13:12 sahar-fehri

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[bot] avatar Dec 10 '25 13:12 github-actions[bot]

✨ Files requiring CODEOWNER review ✨

👨‍🔧 @MetaMask/core-extension-ux (1 files, +9 -5)
  • 📁 ui/
    • 📁 components/
      • 📁 multichain/
        • 📁 import-nfts-modal/
          • 📄 import-nfts-modal.js +9 -5

metamaskbot avatar Dec 10 '25 13:12 metamaskbot

Builds ready [bf062ee]
UI Startup Metrics (1252 ± 102 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup12521029148510213251397
load103286712268310801195
domContentLoaded102686212178210721188
domInteractive2515100192179
firstPaint529142123340810311170
backgroundConnect21519729014220240
firstReactRender473180115570
getState351870114257
initialActions106113
loadScripts817652100780858975
setupStore1263661427
numNetworkReqs1367619669
BrowserifyPower User HomeuiStartup19491552265516920202252
load1102896168114211861322
domContentLoaded1093891167114111791313
domInteractive3117124222891
firstPaint52999168342010081300
backgroundConnect25819774798244549
firstReactRender47397654959
getState20915075295215284
initialActions105112
loadScripts87469014271399611101
setupStore1463751427
numNetworkReqs70581541868120
WebpackStandard HomeuiStartup821682115089891982
load667575100787729825
domContentLoaded66157099587725819
domInteractive251598192286
firstPaint25474868192230706
backgroundConnect1163261327
firstReactRender54332623755135
getState281456113849
initialActions104112
loadScripts65856898986723811
setupStore1163041319
numNetworkReqs1468120677
WebpackPower User HomeuiStartup15011116215820916651833
load7706221250120886958
domContentLoaded7626161245119878946
domInteractive34181502828109
firstPaint355891075251643895
backgroundConnect87769417755641
firstReactRender53428675666
getState19814335541209275
initialActions102012
loadScripts7586131235118871942
setupStore1675191537
numNetworkReqs74572413565174
FirefoxBrowserifyStandard HomeuiStartup13251072195117613991708
load106190213199011151235
domContentLoaded106190113199011151235
domInteractive65312123885139
firstPaint------
backgroundConnect56223425760194
firstReactRender4331497464458
getState147160161426
initialActions103122
loadScripts103288412628110891190
setupStore155199221352
numNetworkReqs1568321876
BrowserifyPower User HomeuiStartup26631611370953830543409
load1673931256749820882501
domContentLoaded1673931256649720872501
domInteractive159321071260105949
firstPaint------
backgroundConnect173271149209182951
firstReactRender5635110136189
getState1306927042158215
initialActions3141627
loadScripts1604916254247620042375
setupStore484109711942190
numNetworkReqs73511392180118
WebpackStandard HomeuiStartup15121255198013915461793
load1253109215499713071420
domContentLoaded1253109215499713061420
domInteractive65271573586130
firstPaint------
backgroundConnect53192013755130
firstReactRender4331103124578
getState14661111546
initialActions102022
loadScripts1222107814978712801388
setupStore165140211248
numNetworkReqs1568221976
WebpackPower User HomeuiStartup29231902443258333853829
load19701177329853524062720
domContentLoaded19701177329753524052720
domInteractive222301112321163989
firstPaint------
backgroundConnect185311235222216970
firstReactRender6243131156596
getState1437828355183259
initialActions3140523
loadScripts18831159309750623332618
setupStore586104212750300
numNetworkReqs75521392568128
📊 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%)

metamaskbot avatar Dec 10 '25 14:12 metamaskbot