Skip to content

Conversation

@amitabh94
Copy link
Contributor

@amitabh94 amitabh94 commented Sep 19, 2025

Description

What is the reason for the change?
When a user adds a new network (e.g., Polygon) and immediately navigates to Swap → Token Picker, the token list shows infinite loading because networks are added to networkConfigurationsByChainId but NOT automatically enabled in enabledNetworkMap. This prevents token detection polling hooks from triggering.

What is the improvement/solution?
Implemented event-driven network enabling in NetworkOrderController to automatically enable newly added networks, triggering token detection and resolving the infinite loading issue.

Changelog

CHANGELOG entry: Fixed token list infinite loading when adding new networks by automatically enabling networks for token detection.

Related issues

Fixes: #35910, ASSETS-1221

Manual testing steps

  1. Go to MetaMask extension
  2. Add a new network (e.g., Polygon) via Settings → Networks → Add Network
  3. Immediately navigate to Swap → Token Picker
  4. Verify that tokens load properly (no infinite loading)
  5. Verify that the network appears in the network list and is enabled
  6. Test with both EVM networks (Polygon) and ensure functionality works

Screenshots/Recordings

Before

  • Adding Polygon network → Navigate to Swap → Token Picker shows infinite loading
  • Tokens only appear after manually switching network filter on main page

Reproducing Bug 35910 - Watch Video

After

  • Adding Polygon network → Navigate to Swap → Token Picker loads tokens immediately
  • No manual intervention required

Bug Fix #35910 - Watch Video

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.

@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 team-swaps-and-bridge Swaps and Bridge team INVALID-PR-TEMPLATE PR's body doesn't match template labels Sep 19, 2025
@amitabh94 amitabh94 added team-assets type-bug Something isn't working Sev1-high High severity; partial loss of service with severe impact upon users, with no workaround. labels Sep 19, 2025
@metamaskbot metamaskbot removed the INVALID-PR-TEMPLATE PR's body doesn't match template label Sep 19, 2025
@metamaskbot
Copy link
Collaborator

📊 Page Load Benchmark Results

Current Commit: 9d8d92f | Date: 9/19/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±69ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 731ms (±82ms) 🟢 | historical mean value: 737ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 78ms (±42ms) 🟢 | historical mean value: 78ms ⬇️ (historical data)
📈 Detailed Results
Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 69ms 1.00s 1.31s 1.24s 1.31s
domContentLoaded 731ms 82ms 692ms 1.26s 917ms 1.26s
firstPaint 78ms 42ms 60ms 488ms 88ms 488ms
firstContentfulPaint 78ms 42ms 60ms 488ms 88ms 488ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Results generated automatically by MetaMask CI

@metamaskbot
Copy link
Collaborator

Builds ready [9d8d92f]
UI Startup Metrics (1256 ± 74 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1256111614337412871404
load108897312757211211238
domContentLoaded108196612677211121231
domInteractive17134861737
firstPaint66787127144510851234
backgroundConnect2522392807255264
firstReactRender24184152734
getState14577101732
initialActions50737611
loadScripts836723102372863994
setupStore1053041120
WebpackHomeuiStartup110092014039211521274
load9117541128839711040
domContentLoaded9057501122839661033
domInteractive16125691443
firstPaint1586432057185269
backgroundConnect181158101746
firstReactRender36335943641
getState74184717
initialActions622351015
loadScripts9027471112829631023
setupStore96193916
FirefoxBrowserifyHomeuiStartup1383123816249414491553
load1198106514017612571329
domContentLoaded1198106414017612571329
domInteractive1023327648107234
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect3619131243496
firstReactRender27234432834
getState53142611
initialActions3111238
loadScripts1169103013607812371307
setupStore11419421838
WebpackHomeuiStartup15531352191815016501873
load13301169167113714481581
domContentLoaded13291168167113714471580
domInteractive103323346495287
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect31204463640
firstReactRender44345854755
getState63182610
initialActions3126335
loadScripts13071150165213814281563
setupStore105747921
Benchmark value 1256 exceeds gate value 1234 for chrome browserify home mean uiStartup
Benchmark value 1089 exceeds gate value 1070 for chrome browserify home mean load
Benchmark value 1082 exceeds gate value 1061 for chrome browserify home mean domContentLoaded
Benchmark value 253 exceeds gate value 10 for chrome browserify home mean backgroundConnect
Benchmark value 25 exceeds gate value 23 for chrome browserify home mean firstReactRender
Benchmark value 5 exceeds gate value 1 for chrome browserify home mean initialActions
Benchmark value 837 exceeds gate value 830 for chrome browserify home mean loadScripts
Benchmark value 1405 exceeds gate value 1365 for chrome browserify home p95 uiStartup
Benchmark value 1238 exceeds gate value 1190 for chrome browserify home p95 load
Benchmark value 1231 exceeds gate value 1180 for chrome browserify home p95 domContentLoaded
Benchmark value 1235 exceeds gate value 1180 for chrome browserify home p95 firstPaint
Benchmark value 264 exceeds gate value 18 for chrome browserify home p95 backgroundConnect
Benchmark value 11 exceeds gate value 1.2 for chrome browserify home p95 initialActions
Benchmark value 995 exceeds gate value 940 for chrome browserify home p95 loadScripts
Benchmark value 20 exceeds gate value 17 for chrome browserify home p95 setupStore
Benchmark value 15 exceeds gate value 7 for chrome webpack home p95 initialActions
Benchmark value 36 exceeds gate value 25 for firefox browserify home mean backgroundConnect
Benchmark value 27 exceeds gate value 25 for firefox browserify home mean firstReactRender
Benchmark value 3 exceeds gate value 1 for firefox browserify home mean initialActions
Benchmark value 12 exceeds gate value 9 for firefox browserify home mean setupStore
Benchmark value 234 exceeds gate value 195 for firefox browserify home p95 domInteractive
Benchmark value 96 exceeds gate value 70 for firefox browserify home p95 backgroundConnect
Benchmark value 8 exceeds gate value 2 for firefox browserify home p95 initialActions
Benchmark value 38 exceeds gate value 27 for firefox browserify home p95 setupStore
Benchmark value 103 exceeds gate value 100 for firefox webpack home mean domInteractive
Benchmark value 31 exceeds gate value 26 for firefox webpack home mean backgroundConnect
Benchmark value 44 exceeds gate value 38 for firefox webpack home mean firstReactRender
Benchmark value 3 exceeds gate value 1 for firefox webpack home mean initialActions
Benchmark value 287 exceeds gate value 156 for firefox webpack home p95 domInteractive
Benchmark value 55 exceeds gate value 50 for firefox webpack home p95 firstReactRender
Benchmark value 5 exceeds gate value 2 for firefox webpack home p95 initialActions
Sum of mean exceeds: 352ms | Sum of p95 exceeds: 736.8ms
Sum of all benchmark exceeds: 1088.8ms

Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 435 Bytes (0.01%)
  • ui: 0 Bytes (0%)
  • common: 10 Bytes (0%)

@amitabh94 amitabh94 removed the team-swaps-and-bridge Swaps and Bridge team label Sep 19, 2025
@metamaskbot
Copy link
Collaborator

📊 Page Load Benchmark Results

Current Commit: 7ab67db | Date: 9/19/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±72ms) 🟡 | historical mean value: 1.06s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 735ms (±69ms) 🟢 | historical mean value: 742ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 77ms (±12ms) 🟢 | historical mean value: 80ms ⬇️ (historical data)
📈 Detailed Results
Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 72ms 1.01s 1.32s 1.31s 1.32s
domContentLoaded 735ms 69ms 697ms 996ms 967ms 996ms
firstPaint 77ms 12ms 64ms 184ms 84ms 184ms
firstContentfulPaint 77ms 12ms 64ms 184ms 84ms 184ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Results generated automatically by MetaMask CI

@metamaskbot
Copy link
Collaborator

Builds ready [7ab67db]
UI Startup Metrics (1185 ± 61 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1185106513786112301294
load101992411625410561096
domContentLoaded101291811535410491090
domInteractive17135781635
firstPaint71172116839510431095
backgroundConnect2112002879213223
firstReactRender25184772742
getState1554881934
initialActions50497518
loadScripts80771394853844884
setupStore1063851219
WebpackHomeuiStartup1162929137910912381312
load974762119410210441110
domContentLoaded969757119010210391105
domInteractive16125481440
firstPaint1636439555183268
backgroundConnect17103971632
firstReactRender36325533643
getState74213714
initialActions62194815
loadScripts966755118710210351099
setupStore86232913
FirefoxBrowserifyHomeuiStartup15201324201114415801943
load1312114516049613781494
domContentLoaded1312114416049613771493
domInteractive1143440458116255
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect42201703038112
firstReactRender30245553140
getState8319620615
initialActions3116339
loadScripts1278112015429013481433
setupStore10510011925
WebpackHomeuiStartup16501412211813617291881
load14111194166911814921625
domContentLoaded14101194166911814921625
domInteractive1103732862103291
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect3421268263846
firstReactRender47406055057
getState6357779
initialActions41981135
loadScripts13871171164211814691601
setupStore962221016
Benchmark value 212 exceeds gate value 10 for chrome browserify home mean backgroundConnect
Benchmark value 26 exceeds gate value 23 for chrome browserify home mean firstReactRender
Benchmark value 6 exceeds gate value 1 for chrome browserify home mean initialActions
Benchmark value 223 exceeds gate value 18 for chrome browserify home p95 backgroundConnect
Benchmark value 34 exceeds gate value 33 for chrome browserify home p95 getState
Benchmark value 18 exceeds gate value 1.2 for chrome browserify home p95 initialActions
Benchmark value 19 exceeds gate value 17 for chrome browserify home p95 setupStore
Benchmark value 15 exceeds gate value 7 for chrome webpack home p95 initialActions
Benchmark value 1521 exceeds gate value 1405 for firefox browserify home mean uiStartup
Benchmark value 1313 exceeds gate value 1245 for firefox browserify home mean load
Benchmark value 1312 exceeds gate value 1239 for firefox browserify home mean domContentLoaded
Benchmark value 115 exceeds gate value 110 for firefox browserify home mean domInteractive
Benchmark value 42 exceeds gate value 25 for firefox browserify home mean backgroundConnect
Benchmark value 30 exceeds gate value 25 for firefox browserify home mean firstReactRender
Benchmark value 4 exceeds gate value 1 for firefox browserify home mean initialActions
Benchmark value 1279 exceeds gate value 1230 for firefox browserify home mean loadScripts
Benchmark value 11 exceeds gate value 9 for firefox browserify home mean setupStore
Benchmark value 1943 exceeds gate value 1660 for firefox browserify home p95 uiStartup
Benchmark value 255 exceeds gate value 195 for firefox browserify home p95 domInteractive
Benchmark value 112 exceeds gate value 70 for firefox browserify home p95 backgroundConnect
Benchmark value 9 exceeds gate value 2 for firefox browserify home p95 initialActions
Benchmark value 1651 exceeds gate value 1615 for firefox webpack home mean uiStartup
Benchmark value 1411 exceeds gate value 1380 for firefox webpack home mean load
Benchmark value 1411 exceeds gate value 1380 for firefox webpack home mean domContentLoaded
Benchmark value 111 exceeds gate value 100 for firefox webpack home mean domInteractive
Benchmark value 35 exceeds gate value 26 for firefox webpack home mean backgroundConnect
Benchmark value 48 exceeds gate value 38 for firefox webpack home mean firstReactRender
Benchmark value 5 exceeds gate value 1 for firefox webpack home mean initialActions
Benchmark value 1387 exceeds gate value 1360 for firefox webpack home mean loadScripts
Benchmark value 291 exceeds gate value 156 for firefox webpack home p95 domInteractive
Benchmark value 57 exceeds gate value 50 for firefox webpack home p95 firstReactRender
Benchmark value 5 exceeds gate value 2 for firefox webpack home p95 initialActions
Sum of mean exceeds: 707ms | Sum of p95 exceeds: 769.8ms
Sum of all benchmark exceeds: 1476.8ms

Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 435 Bytes (0.01%)
  • ui: 0 Bytes (0%)
  • common: 10 Bytes (0%)

@metamaskbot
Copy link
Collaborator

📊 Page Load Benchmark Results

Current Commit: c0b965b | Date: 9/19/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±73ms) 🟡 | historical mean value: 1.06s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 736ms (±69ms) 🟢 | historical mean value: 742ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 76ms (±12ms) 🟢 | historical mean value: 78ms ⬇️ (historical data)
📈 Detailed Results
Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 73ms 1.01s 1.34s 1.26s 1.34s
domContentLoaded 736ms 69ms 703ms 1.01s 940ms 1.01s
firstPaint 76ms 12ms 56ms 180ms 84ms 180ms
firstContentfulPaint 76ms 12ms 56ms 180ms 84ms 180ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Results generated automatically by MetaMask CI

@metamaskbot
Copy link
Collaborator

Builds ready [c0b965b]
UI Startup Metrics (1193 ± 63 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1193108613476312261314
load102692511936010501145
domContentLoaded101992111835910431133
domInteractive17134161738
firstPaint736157119138810401139
backgroundConnect2112032325214222
firstReactRender26176082844
getState14586101828
initialActions41194613
loadScripts81472197058837927
setupStore952741017
WebpackHomeuiStartup1205953143111012831349
load1007778115910310761135
domContentLoaded1001774115210410711131
domInteractive17126491540
firstPaint1526548668176277
backgroundConnect18115171933
firstReactRender38335343848
getState74274716
initialActions62244916
loadScripts997772115010410681128
setupStore961721013
FirefoxBrowserifyHomeuiStartup13941200198113014541659
load1207105017319212751334
domContentLoaded1206104917299212751333
domInteractive993239157101240
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect3319121163572
firstReactRender28235352941
getState72629619
initialActions31446310
loadScripts1182103217089212461309
setupStore11421023821
WebpackHomeuiStartup16481418236215917441910
load14061202176713514841676
domContentLoaded14061201176713514831675
domInteractive1103934961107305
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect31215173645
firstReactRender47366455054
getState73689717
initialActions612052436
loadScripts13831173174613614591654
setupStore126187181019
Benchmark value 212 exceeds gate value 10 for chrome browserify home mean backgroundConnect
Benchmark value 26 exceeds gate value 23 for chrome browserify home mean firstReactRender
Benchmark value 5 exceeds gate value 1 for chrome browserify home mean initialActions
Benchmark value 223 exceeds gate value 18 for chrome browserify home p95 backgroundConnect
Benchmark value 13 exceeds gate value 1.2 for chrome browserify home p95 initialActions
Benchmark value 16 exceeds gate value 7 for chrome webpack home p95 initialActions
Benchmark value 33 exceeds gate value 25 for firefox browserify home mean backgroundConnect
Benchmark value 28 exceeds gate value 25 for firefox browserify home mean firstReactRender
Benchmark value 4 exceeds gate value 1 for firefox browserify home mean initialActions
Benchmark value 12 exceeds gate value 9 for firefox browserify home mean setupStore
Benchmark value 240 exceeds gate value 195 for firefox browserify home p95 domInteractive
Benchmark value 72 exceeds gate value 70 for firefox browserify home p95 backgroundConnect
Benchmark value 10 exceeds gate value 2 for firefox browserify home p95 initialActions
Benchmark value 1649 exceeds gate value 1615 for firefox webpack home mean uiStartup
Benchmark value 1407 exceeds gate value 1380 for firefox webpack home mean load
Benchmark value 1406 exceeds gate value 1380 for firefox webpack home mean domContentLoaded
Benchmark value 110 exceeds gate value 100 for firefox webpack home mean domInteractive
Benchmark value 31 exceeds gate value 26 for firefox webpack home mean backgroundConnect
Benchmark value 47 exceeds gate value 38 for firefox webpack home mean firstReactRender
Benchmark value 7 exceeds gate value 1 for firefox webpack home mean initialActions
Benchmark value 1384 exceeds gate value 1360 for firefox webpack home mean loadScripts
Benchmark value 1676 exceeds gate value 1660 for firefox webpack home p95 load
Benchmark value 1675 exceeds gate value 1660 for firefox webpack home p95 domContentLoaded
Benchmark value 305 exceeds gate value 156 for firefox webpack home p95 domInteractive
Benchmark value 54 exceeds gate value 50 for firefox webpack home p95 firstReactRender
Benchmark value 6 exceeds gate value 2 for firefox webpack home p95 initialActions
Benchmark value 1654 exceeds gate value 1630 for firefox webpack home p95 loadScripts
Sum of mean exceeds: 367ms | Sum of p95 exceeds: 492.8ms
Sum of all benchmark exceeds: 859.8ms

Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 1.84 KiB (0.04%)
  • ui: -302 Bytes (0%)
  • common: 360 Bytes (0%)

This commit introduces functionality to enable networks when the `NetworkController:networkAdded` event is emitted. It updates the `NetworkOrderController` to handle both EVM and non-EVM networks, ensuring that the state reflects the newly added networks correctly. Additionally, tests have been added to verify the expected behavior upon receiving network addition events.
…erMessenger

This commit updates the NetworkOrderControllerMessenger to handle the 'NetworkController:networkAdded' event, allowing the application to respond appropriately when new networks are added. The allowed events list has been modified to include this new event, ensuring that the state reflects changes in network availability. This enhancement improves the overall functionality of the network management system.
…aming changes

This commit modifies the test for `getNetworkOrderControllerMessenger` to use the correct variable name `networkOrderControllerMessenger` instead of `nftControllerMessenger`. This change ensures clarity and consistency in the test code, aligning with the recent updates in the messenger implementation.
…tworks

This commit updates the NetworkOrderController to differentiate between featured networks and custom networks when the 'NetworkController:networkAdded' event is emitted. It modifies the state management logic to enable featured networks while ensuring that only custom networks are enabled when added, disabling all others. Additionally, the corresponding test cases have been updated to reflect these changes, ensuring accurate coverage of the new functionality.
This commit refines the switch network test by removing redundant checks for the Localhost 8545 network and consolidating the Arbitrum network addition into a single step. This enhances test clarity and efficiency while ensuring the local node balance is verified after the network switch.
@amitabh94 amitabh94 force-pushed the ASSETS-1221-bug-token-list-does-not-refresh-after-adding-new-network branch from 53a8d45 to 6b0163a Compare September 20, 2025 01:47
@metamaskbot
Copy link
Collaborator

📊 Page Load Benchmark Results

Current Commit: 6b0163a | Date: 9/20/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±69ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 730ms (±67ms) 🟢 | historical mean value: 735ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 76ms (±12ms) 🟢 | historical mean value: 76ms ⬇️ (historical data)
📈 Detailed Results
Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 69ms 1.00s 1.31s 1.25s 1.31s
domContentLoaded 730ms 67ms 694ms 988ms 930ms 988ms
firstPaint 76ms 12ms 60ms 176ms 88ms 176ms
firstContentfulPaint 76ms 12ms 60ms 176ms 88ms 176ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Results generated automatically by MetaMask CI

@metamaskbot
Copy link
Collaborator

Builds ready [6b0163a]
UI Startup Metrics (1206 ± 66 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1206108014586612411345
load103692911915410701119
domContentLoaded102992311865410621114
domInteractive18136381739
firstPaint61987119041810501102
backgroundConnect2142012416217225
firstReactRender25195162737
getState155113131833
initialActions50295615
loadScripts82172098653851909
setupStore1053141218
WebpackHomeuiStartup1150919137910612241291
load968757120310210401099
domContentLoaded963753120010310371096
domInteractive16125791439
firstPaint1536234656178269
backgroundConnect16103461632
firstReactRender35324323540
getState74223712
initialActions62275818
loadScripts960751119810210341093
setupStore96212913
FirefoxBrowserifyHomeuiStartup14121222192013114841687
load1217106614918712691386
domContentLoaded1217106514918712681386
domInteractive1073544968111267
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect3319114153472
firstReactRender29235763143
getState9217419629
initialActions401071137
loadScripts1192104914648612461366
setupStore12516017935
WebpackHomeuiStartup16841462219317917812075
load14321232197715315371707
domContentLoaded14321232197615315361707
domInteractive1146047866111287
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect34246283951
firstReactRender49408265160
getState8316017619
initialActions511931947
loadScripts14071206195015415091683
setupStore1156871022
Benchmark value 215 exceeds gate value 10 for chrome browserify home mean backgroundConnect
Benchmark value 26 exceeds gate value 23 for chrome browserify home mean firstReactRender
Benchmark value 16 exceeds gate value 15 for chrome browserify home mean getState
Benchmark value 6 exceeds gate value 1 for chrome browserify home mean initialActions
Benchmark value 225 exceeds gate value 18 for chrome browserify home p95 backgroundConnect
Benchmark value 15 exceeds gate value 1.2 for chrome browserify home p95 initialActions
Benchmark value 18 exceeds gate value 17 for chrome browserify home p95 setupStore
Benchmark value 18 exceeds gate value 7 for chrome webpack home p95 initialActions
Benchmark value 1412 exceeds gate value 1405 for firefox browserify home mean uiStartup
Benchmark value 33 exceeds gate value 25 for firefox browserify home mean backgroundConnect
Benchmark value 30 exceeds gate value 25 for firefox browserify home mean firstReactRender
Benchmark value 4 exceeds gate value 1 for firefox browserify home mean initialActions
Benchmark value 12 exceeds gate value 9 for firefox browserify home mean setupStore
Benchmark value 1687 exceeds gate value 1660 for firefox browserify home p95 uiStartup
Benchmark value 267 exceeds gate value 195 for firefox browserify home p95 domInteractive
Benchmark value 72 exceeds gate value 70 for firefox browserify home p95 backgroundConnect
Benchmark value 29 exceeds gate value 24 for firefox browserify home p95 getState
Benchmark value 7 exceeds gate value 2 for firefox browserify home p95 initialActions
Benchmark value 35 exceeds gate value 27 for firefox browserify home p95 setupStore
Benchmark value 1684 exceeds gate value 1615 for firefox webpack home mean uiStartup
Benchmark value 1433 exceeds gate value 1380 for firefox webpack home mean load
Benchmark value 1432 exceeds gate value 1380 for firefox webpack home mean domContentLoaded
Benchmark value 114 exceeds gate value 100 for firefox webpack home mean domInteractive
Benchmark value 35 exceeds gate value 26 for firefox webpack home mean backgroundConnect
Benchmark value 49 exceeds gate value 38 for firefox webpack home mean firstReactRender
Benchmark value 6 exceeds gate value 1 for firefox webpack home mean initialActions
Benchmark value 1408 exceeds gate value 1360 for firefox webpack home mean loadScripts
Benchmark value 2075 exceeds gate value 1935 for firefox webpack home p95 uiStartup
Benchmark value 1707 exceeds gate value 1660 for firefox webpack home p95 load
Benchmark value 1707 exceeds gate value 1660 for firefox webpack home p95 domContentLoaded
Benchmark value 287 exceeds gate value 156 for firefox webpack home p95 domInteractive
Benchmark value 51 exceeds gate value 49 for firefox webpack home p95 backgroundConnect
Benchmark value 60 exceeds gate value 50 for firefox webpack home p95 firstReactRender
Benchmark value 7 exceeds gate value 2 for firefox webpack home p95 initialActions
Benchmark value 1683 exceeds gate value 1630 for firefox webpack home p95 loadScripts
Sum of mean exceeds: 501ms | Sum of p95 exceeds: 786.8ms
Sum of all benchmark exceeds: 1287.8ms

Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 535 Bytes (0.01%)
  • ui: 0 Bytes (0%)
  • common: 10 Bytes (0%)

This commit modifies the switch network test to replace checks for local node balances with assertions for expected balances in both ETH and USD. This change enhances the clarity of the test by ensuring it verifies the correct balance display after switching networks, improving overall test accuracy and maintainability.
@metamaskbot
Copy link
Collaborator

📊 Page Load Benchmark Results

Current Commit: b011c80 | Date: 9/20/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.08s (±83ms) 🟡 | historical mean value: 1.05s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 758ms (±94ms) 🟢 | historical mean value: 735ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 90ms (±130ms) 🟢 | historical mean value: 76ms ⬆️ (historical data)
📈 Detailed Results
Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.08s 83ms 1.03s 1.39s 1.32s 1.39s
domContentLoaded 758ms 94ms 717ms 1.31s 997ms 1.31s
firstPaint 90ms 130ms 60ms 1.38s 88ms 1.38s
firstContentfulPaint 90ms 130ms 60ms 1.38s 88ms 1.38s
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Results generated automatically by MetaMask CI

@metamaskbot
Copy link
Collaborator

Builds ready [b011c80]
UI Startup Metrics (1205 ± 70 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1205106814577012541331
load103191512046410781162
domContentLoaded102490711996410691153
domInteractive18135481738
firstPaint60387114240910331107
backgroundConnect2152022396217227
firstReactRender2817135162943
getState15574101934
initialActions50436615
loadScripts81769999363862940
setupStore1062441218
WebpackHomeuiStartup1147930139310612241288
load96476311449910321093
domContentLoaded95875811399910271087
domInteractive16126891440
firstPaint1566131758180299
backgroundConnect17123861730
firstReactRender35335833540
getState74233712
initialActions62154814
loadScripts95675611379810251084
setupStore96222913
FirefoxBrowserifyHomeuiStartup13901212178911814461666
load1201105614528112581344
domContentLoaded1201105614528112581344
domInteractive95332844497210
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect3419185253289
firstReactRender29236063140
getState63284612
initialActions419610310
loadScripts1176103813407712331309
setupStore1049013837
WebpackHomeuiStartup15311378215815616091849
load13081162166113213981607
domContentLoaded13071162166113313971607
domInteractive103263426399284
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect31215463640
firstReactRender44365844752
getState5310169
initialActions3186837
loadScripts12851145163913313741572
setupStore11515717913
Benchmark value 215 exceeds gate value 10 for chrome browserify home mean backgroundConnect
Benchmark value 29 exceeds gate value 23 for chrome browserify home mean firstReactRender
Benchmark value 16 exceeds gate value 15 for chrome browserify home mean getState
Benchmark value 6 exceeds gate value 1 for chrome browserify home mean initialActions
Benchmark value 227 exceeds gate value 18 for chrome browserify home p95 backgroundConnect
Benchmark value 34 exceeds gate value 33 for chrome browserify home p95 getState
Benchmark value 15 exceeds gate value 1.2 for chrome browserify home p95 initialActions
Benchmark value 18 exceeds gate value 17 for chrome browserify home p95 setupStore
Benchmark value 14 exceeds gate value 7 for chrome webpack home p95 initialActions
Benchmark value 34 exceeds gate value 25 for firefox browserify home mean backgroundConnect
Benchmark value 29 exceeds gate value 25 for firefox browserify home mean firstReactRender
Benchmark value 5 exceeds gate value 1 for firefox browserify home mean initialActions
Benchmark value 11 exceeds gate value 9 for firefox browserify home mean setupStore
Benchmark value 1666 exceeds gate value 1660 for firefox browserify home p95 uiStartup
Benchmark value 210 exceeds gate value 195 for firefox browserify home p95 domInteractive
Benchmark value 89 exceeds gate value 70 for firefox browserify home p95 backgroundConnect
Benchmark value 10 exceeds gate value 2 for firefox browserify home p95 initialActions
Benchmark value 37 exceeds gate value 27 for firefox browserify home p95 setupStore
Benchmark value 104 exceeds gate value 100 for firefox webpack home mean domInteractive
Benchmark value 32 exceeds gate value 26 for firefox webpack home mean backgroundConnect
Benchmark value 44 exceeds gate value 38 for firefox webpack home mean firstReactRender
Benchmark value 4 exceeds gate value 1 for firefox webpack home mean initialActions
Benchmark value 284 exceeds gate value 156 for firefox webpack home p95 domInteractive
Benchmark value 52 exceeds gate value 50 for firefox webpack home p95 firstReactRender
Benchmark value 7 exceeds gate value 2 for firefox webpack home p95 initialActions
Sum of mean exceeds: 255ms | Sum of p95 exceeds: 424.8ms
Sum of all benchmark exceeds: 679.8ms

Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 535 Bytes (0.01%)
  • ui: 0 Bytes (0%)
  • common: 10 Bytes (0%)

@amitabh94 amitabh94 marked this pull request as ready for review September 20, 2025 04:15
state.enabledNetworkMap[namespace][caipId] = true;
});
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Network Map Access and Type Mismatch

In onNetworkAdded, accessing state.enabledNetworkMap[namespace] without ensuring the namespace key exists can cause a TypeError when adding new or uninitialized network namespaces. Additionally, the networkId parameter is typed as Hex but also handles CAIP chain IDs, which is inaccurate.

Fix in Cursor Fix in Web

@amitabh94
Copy link
Contributor Author

amitabh94 commented Sep 23, 2025

Closing this PR in favor of long term fix with the help of this migration PR to core controllers.

The issue related to this PR was fixed in a separate PR.
cc: @salimtb

@amitabh94 amitabh94 closed this Sep 23, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Sep 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Sev1-high High severity; partial loss of service with severe impact upon users, with no workaround. size-M team-assets type-bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Token list does not refresh after adding new network, causing infinite loading in swap token picker and no tokens available in Send Token picker

3 participants