Skip to content

Conversation

@Prithpal-Sooriya
Copy link
Contributor

@Prithpal-Sooriya Prithpal-Sooriya commented Jul 17, 2025

Description

TDB

Open in GitHub Codespaces

Changelog

CHANGELOG entry:

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

https://www.loom.com/share/5383890221bf459f89f1138e59077c1f?sid=d0d480a4-5949-4b54-b37f-df449a178e30

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.

Comment on lines +184 to +172
dispatch(
setEnabledNetworks(newNetworkEnabledEvmNetworks, namespace),
);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the special magic sauce...

For send flows we set the enable network before switching to it.
So similarly, swaps/bridge flows need to ensure that the network is enabled before we can switch to it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It would be ideal that the NetworkOrderController only be responsible for the UI, but we are very closely coupled with the the NetworkController & the selected network.

For example, all of our polling mechanisms rely on the NetworkOrderController, since we are polling on networks a user has toggled.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cleaned this up - it now only enabled missing networks, it does not move to active network.

Copy link
Member

Choose a reason for hiding this comment

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

Re: enabling a network before we switch to it

There are a number of instances where the network is switched before routing to the bridge page (see openBridgeExperience usages). Does the network need to be enabled before those routing calls too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

CC @salimtb for visibility on this.

Longer term I would really like to decouple the need for bridging/swaps/send to rely on this NetworkOrderController.
I don't have as much understanding on the connections that these pages have to this controller. If it is just related to polling, then I feel like we should allow these pages to poll independently from the home screen.

Copy link
Contributor

Choose a reason for hiding this comment

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

@micaelae yes, I believe the network needs to be enabled — otherwise, certain data like balances and conversion rates won’t be updated. As @Prithpal-Sooriya mentioned, we only keep balances, token metadata, and prices up to date for enabled networks.

Copy link
Contributor

Choose a reason for hiding this comment

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

the ideal solution will be to create a separated polling for the enabled swaps network when the users start the flow if you see what i mean , but we can do this separately

@metamaskbot
Copy link
Collaborator

metamaskbot commented Jul 17, 2025

✨ Files requiring CODEOWNER review ✨

🔄 @MetaMask/swaps-engineers (3 files, +181 -2)
  • 📁 test/
    • 📁 e2e/
      • 📁 tests/
        • 📁 bridge/
          • 📄 bridge-positive-cases.spec.ts +56 -1
  • 📁 ui/
    • 📁 pages/
      • 📁 bridge/
        • 📁 prepare/
          • 📄 prepare-bridge-page.test.tsx +72 -1
          • 📄 prepare-bridge-page.tsx +53 -0

@metamaskbot
Copy link
Collaborator

Builds ready [a9ae33f]
UI Startup Metrics (1263 ± 58 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1263112414045813031358
load108296711735311221154
domContentLoaded107596211585311151149
domInteractive18146191742
firstPaint681129117443511031153
backgroundConnect2111972428213228
firstReactRender21146172233
getState1143271426
initialActions30204216
loadScripts87176195252912948
setupStore74192812
WebpackHomeuiStartup23591854266016124742559
load18641348217915719572054
domContentLoaded18561342217515819482050
domInteractive2012228261458
firstPaint1646048178198322
backgroundConnect38103015830233
firstReactRender1788944078214334
getState1145261322
initialActions9218022628
loadScripts18521338217215819452047
setupStore156211211729
FirefoxBrowserifyHomeuiStartup14821301217515515081850
load1279111116709713281459
domContentLoaded1279111016709713281459
domInteractive1102845971105288
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2814199242570
firstReactRender282064102956
getState10323524726
initialActions40537317
loadScripts1255109716459313031431
setupStore16328641786
WebpackHomeuiStartup18271578254319619442190
load15331341211415116421874
domContentLoaded15331340211415116411873
domInteractive97333686389313
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect3522238253980
firstReactRender55436865965
getState133228241438
initialActions10124632920
loadScripts15051319207614716011802
setupStore185257381563
Benchmark value 1264 exceeds gate value 1234 for chrome browserify home mean uiStartup
Benchmark value 1082 exceeds gate value 1070 for chrome browserify home mean load
Benchmark value 1075 exceeds gate value 1061 for chrome browserify home mean domContentLoaded
Benchmark value 212 exceeds gate value 10 for chrome browserify home mean backgroundConnect
Benchmark value 3 exceeds gate value 1 for chrome browserify home mean initialActions
Benchmark value 871 exceeds gate value 830 for chrome browserify home mean loadScripts
Benchmark value 42 exceeds gate value 41 for chrome browserify home p95 domInteractive
Benchmark value 229 exceeds gate value 18 for chrome browserify home p95 backgroundConnect
Benchmark value 16 exceeds gate value 1.2 for chrome browserify home p95 initialActions
Benchmark value 948 exceeds gate value 940 for chrome browserify home p95 loadScripts
Benchmark value 2360 exceeds gate value 2192 for chrome webpack home mean uiStartup
Benchmark value 1865 exceeds gate value 1711 for chrome webpack home mean load
Benchmark value 1857 exceeds gate value 1704 for chrome webpack home mean domContentLoaded
Benchmark value 9 exceeds gate value 7 for chrome webpack home mean initialActions
Benchmark value 1852 exceeds gate value 1699 for chrome webpack home mean loadScripts
Benchmark value 2559 exceeds gate value 2454 for chrome webpack home p95 uiStartup
Benchmark value 2054 exceeds gate value 2030 for chrome webpack home p95 load
Benchmark value 2050 exceeds gate value 2005 for chrome webpack home p95 domContentLoaded
Benchmark value 58 exceeds gate value 57 for chrome webpack home p95 domInteractive
Benchmark value 233 exceeds gate value 90 for chrome webpack home p95 backgroundConnect
Benchmark value 28 exceeds gate value 7 for chrome webpack home p95 initialActions
Benchmark value 2048 exceeds gate value 1970 for chrome webpack home p95 loadScripts
Benchmark value 1482 exceeds gate value 1405 for firefox browserify home mean uiStartup
Benchmark value 1279 exceeds gate value 1245 for firefox browserify home mean load
Benchmark value 1279 exceeds gate value 1239 for firefox browserify home mean domContentLoaded
Benchmark value 28 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 4 exceeds gate value 1 for firefox browserify home mean initialActions
Benchmark value 1256 exceeds gate value 1230 for firefox browserify home mean loadScripts
Benchmark value 16 exceeds gate value 9 for firefox browserify home mean setupStore
Benchmark value 1850 exceeds gate value 1660 for firefox browserify home p95 uiStartup
Benchmark value 288 exceeds gate value 195 for firefox browserify home p95 domInteractive
Benchmark value 56 exceeds gate value 55 for firefox browserify home p95 firstReactRender
Benchmark value 26 exceeds gate value 24 for firefox browserify home p95 getState
Benchmark value 17 exceeds gate value 2 for firefox browserify home p95 initialActions
Benchmark value 86 exceeds gate value 27 for firefox browserify home p95 setupStore
Benchmark value 1828 exceeds gate value 1615 for firefox webpack home mean uiStartup
Benchmark value 1534 exceeds gate value 1380 for firefox webpack home mean load
Benchmark value 1533 exceeds gate value 1380 for firefox webpack home mean domContentLoaded
Benchmark value 36 exceeds gate value 26 for firefox webpack home mean backgroundConnect
Benchmark value 55 exceeds gate value 38 for firefox webpack home mean firstReactRender
Benchmark value 10 exceeds gate value 1 for firefox webpack home mean initialActions
Benchmark value 1505 exceeds gate value 1360 for firefox webpack home mean loadScripts
Benchmark value 19 exceeds gate value 13 for firefox webpack home mean setupStore
Benchmark value 2190 exceeds gate value 1935 for firefox webpack home p95 uiStartup
Benchmark value 1874 exceeds gate value 1660 for firefox webpack home p95 load
Benchmark value 1873 exceeds gate value 1660 for firefox webpack home p95 domContentLoaded
Benchmark value 313 exceeds gate value 156 for firefox webpack home p95 domInteractive
Benchmark value 80 exceeds gate value 49 for firefox webpack home p95 backgroundConnect
Benchmark value 65 exceeds gate value 50 for firefox webpack home p95 firstReactRender
Benchmark value 38 exceeds gate value 32 for firefox webpack home p95 getState
Benchmark value 20 exceeds gate value 2 for firefox webpack home p95 initialActions
Benchmark value 1802 exceeds gate value 1630 for firefox webpack home p95 loadScripts
Benchmark value 63 exceeds gate value 28 for firefox webpack home p95 setupStore
Sum of mean exceeds: 1832ms | Sum of p95 exceeds: 2127.8ms
Sum of all benchmark exceeds: 3959.8ms

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

@Prithpal-Sooriya
Copy link
Contributor Author

This has broken from recent swap/bridge changes.
ccc67c9
17fed38

const { namespace } = parseCaipChainId(caipChainId);

if (namespace) {
const isPopularNetwork = FEATURED_NETWORK_CHAIN_IDS.includes(chainId);
Copy link
Member

Choose a reason for hiding this comment

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

Should this enable all featured networks or just the user's imported chains that are also allowlisted by the bridge service (getFromChains)?

Copy link
Member

Choose a reason for hiding this comment

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

What are the other implications of not adding a network to the enabled list? I wonder if this should happen earlier on in the application loading process (maybe in the useBridging hook) so Swap/Bridge networks are enabled by default, regardless of whether the user loads this component. Transaction status polling, for example, is done in the background

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great Q, will ask the team and test it out.
This realistically is just a patch, ideally we should fully decouple/remove the need to manage enabled networks on these pages/flows.

Copy link
Contributor

@salimtb salimtb Jul 18, 2025

Choose a reason for hiding this comment

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

Another important implication is that if a network is selected as the source or destination in the swap flow, it must be enabled; otherwise, users won’t see their assets in the token list, leading to a poor user experience.

@salimtb salimtb force-pushed the fix/enable-deselected-network-in-swap-bridge-flow branch from a9ae33f to db12945 Compare July 18, 2025 10:03
@metamaskbot
Copy link
Collaborator

Builds ready [db12945]
UI Startup Metrics (1327 ± 72 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1327112615127213741457
load114097913326511881263
domContentLoaded113297413276611751258
domInteractive20146591842
firstPaint62874133446311271219
backgroundConnect2222052509227242
firstReactRender2316165152437
getState1044171127
initialActions30325212
loadScripts9177621110649631037
setupStore74333712
WebpackHomeuiStartup24002007270713324952620
load19091501224115619922153
domContentLoaded19001473223716019862146
domInteractive1913136171562
firstPaint1606239269194293
backgroundConnect3110281363149
firstReactRender1758934572209323
getState133251261319
initialActions7214715727
loadScripts18951468223415919832143
setupStore176188251727
FirefoxBrowserifyHomeuiStartup14641304204513714891800
load1266112916569412991497
domContentLoaded1265112916569412991497
domInteractive1103756572104307
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2713100152567
firstReactRender291968103057
getState12320327637
initialActions30294211
loadScripts1245111316409212771475
setupStore949211821
WebpackHomeuiStartup19941713264222521282459
load16941443220119318492075
domContentLoaded16931442220119318482075
domInteractive1266449496116403
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect3820103174479
firstReactRender57457776070
getState1144081625
initialActions90167191122
loadScripts16651410215319018232037
setupStore13598141431
cc: @HowardBraham
Benchmark value 1327 exceeds gate value 1234 for chrome browserify home mean uiStartup
Benchmark value 1140 exceeds gate value 1070 for chrome browserify home mean load
Benchmark value 1132 exceeds gate value 1061 for chrome browserify home mean domContentLoaded
Benchmark value 222 exceeds gate value 10 for chrome browserify home mean backgroundConnect
Benchmark value 24 exceeds gate value 23 for chrome browserify home mean firstReactRender
Benchmark value 3 exceeds gate value 1 for chrome browserify home mean initialActions
Benchmark value 917 exceeds gate value 830 for chrome browserify home mean loadScripts
Benchmark value 1457 exceeds gate value 1365 for chrome browserify home p95 uiStartup
Benchmark value 1263 exceeds gate value 1190 for chrome browserify home p95 load
Benchmark value 1258 exceeds gate value 1180 for chrome browserify home p95 domContentLoaded
Benchmark value 42 exceeds gate value 41 for chrome browserify home p95 domInteractive
Benchmark value 1220 exceeds gate value 1180 for chrome browserify home p95 firstPaint
Benchmark value 243 exceeds gate value 18 for chrome browserify home p95 backgroundConnect
Benchmark value 12 exceeds gate value 1.2 for chrome browserify home p95 initialActions
Benchmark value 1037 exceeds gate value 940 for chrome browserify home p95 loadScripts
Benchmark value 2401 exceeds gate value 2192 for chrome webpack home mean uiStartup
Benchmark value 1909 exceeds gate value 1711 for chrome webpack home mean load
Benchmark value 1900 exceeds gate value 1704 for chrome webpack home mean domContentLoaded
Benchmark value 8 exceeds gate value 7 for chrome webpack home mean initialActions
Benchmark value 1896 exceeds gate value 1699 for chrome webpack home mean loadScripts
Benchmark value 2621 exceeds gate value 2454 for chrome webpack home p95 uiStartup
Benchmark value 2153 exceeds gate value 2030 for chrome webpack home p95 load
Benchmark value 2146 exceeds gate value 2005 for chrome webpack home p95 domContentLoaded
Benchmark value 62 exceeds gate value 57 for chrome webpack home p95 domInteractive
Benchmark value 27 exceeds gate value 7 for chrome webpack home p95 initialActions
Benchmark value 2144 exceeds gate value 1970 for chrome webpack home p95 loadScripts
Benchmark value 1465 exceeds gate value 1405 for firefox browserify home mean uiStartup
Benchmark value 1266 exceeds gate value 1245 for firefox browserify home mean load
Benchmark value 1266 exceeds gate value 1239 for firefox browserify home mean domContentLoaded
Benchmark value 111 exceeds gate value 110 for firefox browserify home mean domInteractive
Benchmark value 27 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 12 exceeds gate value 11 for firefox browserify home mean getState
Benchmark value 3 exceeds gate value 1 for firefox browserify home mean initialActions
Benchmark value 1245 exceeds gate value 1230 for firefox browserify home mean loadScripts
Benchmark value 1800 exceeds gate value 1660 for firefox browserify home p95 uiStartup
Benchmark value 1497 exceeds gate value 1495 for firefox browserify home p95 load
Benchmark value 1497 exceeds gate value 1495 for firefox browserify home p95 domContentLoaded
Benchmark value 307 exceeds gate value 195 for firefox browserify home p95 domInteractive
Benchmark value 57 exceeds gate value 55 for firefox browserify home p95 firstReactRender
Benchmark value 37 exceeds gate value 24 for firefox browserify home p95 getState
Benchmark value 11 exceeds gate value 2 for firefox browserify home p95 initialActions
Benchmark value 1994 exceeds gate value 1615 for firefox webpack home mean uiStartup
Benchmark value 1694 exceeds gate value 1380 for firefox webpack home mean load
Benchmark value 1694 exceeds gate value 1380 for firefox webpack home mean domContentLoaded
Benchmark value 126 exceeds gate value 100 for firefox webpack home mean domInteractive
Benchmark value 39 exceeds gate value 26 for firefox webpack home mean backgroundConnect
Benchmark value 57 exceeds gate value 38 for firefox webpack home mean firstReactRender
Benchmark value 9 exceeds gate value 1 for firefox webpack home mean initialActions
Benchmark value 1665 exceeds gate value 1360 for firefox webpack home mean loadScripts
Benchmark value 2459 exceeds gate value 1935 for firefox webpack home p95 uiStartup
Benchmark value 2075 exceeds gate value 1660 for firefox webpack home p95 load
Benchmark value 2075 exceeds gate value 1660 for firefox webpack home p95 domContentLoaded
Benchmark value 403 exceeds gate value 156 for firefox webpack home p95 domInteractive
Benchmark value 79 exceeds gate value 49 for firefox webpack home p95 backgroundConnect
Benchmark value 70 exceeds gate value 50 for firefox webpack home p95 firstReactRender
Benchmark value 22 exceeds gate value 2 for firefox webpack home p95 initialActions
Benchmark value 2037 exceeds gate value 1630 for firefox webpack home p95 loadScripts
Benchmark value 31 exceeds gate value 28 for firefox webpack home p95 setupStore
Sum of mean exceeds: 2848ms | Sum of p95 exceeds: 3607.8ms
Sum of all benchmark exceeds: 6455.8ms

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

@salimtb salimtb changed the title fix: ensure we enable any missing networks when performing swap/bridge. fix: cp-13.0.0 ensure we enable any missing networks when performing swap/bridge. Jul 18, 2025
@salimtb salimtb marked this pull request as ready for review July 18, 2025 12:56
@salimtb salimtb requested a review from a team as a code owner July 18, 2025 12:56
@salimtb salimtb requested review from micaelae and salimtb July 18, 2025 12:56
salimtb
salimtb previously approved these changes Jul 18, 2025
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

salimtb
salimtb previously approved these changes Jul 18, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [05141ef]
UI Startup Metrics (1262 ± 54 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1262113414135413051347
load108293912105011181161
domContentLoaded107593412055111091155
domInteractive18134771737
firstPaint709113116943511051150
backgroundConnect21319926610216231
firstReactRender22155572438
getState11483101231
initialActions30376314
loadScripts86973398348905942
setupStore74223812
WebpackHomeuiStartup24191926268614425132616
load19191408228817320212187
domContentLoaded19121402228417320162182
domInteractive201388161572
firstPaint185641797179219287
backgroundConnect41122876233275
firstReactRender1659234061203282
getState134216211323
initialActions11217928737
loadScripts19071398228117320132177
setupStore216232351837
FirefoxBrowserifyHomeuiStartup14871303228914915291787
load1283114615289213321474
domContentLoaded1283114615279213311474
domInteractive1113759983108303
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect261386112751
firstReactRender3021228222957
getState162213341092
initialActions40769213
loadScripts1261112915059113091453
setupStore83728624
WebpackHomeuiStartup17801550250718318882150
load14931285186814115761805
domContentLoaded14931285186714115761804
domInteractive100353996792323
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect291988123359
firstReactRender53427465866
getState123234241537
initialActions7123223517
loadScripts14701265182613915521763
setupStore2242574912124
Benchmark value 1263 exceeds gate value 1234 for chrome browserify home mean uiStartup
Benchmark value 1083 exceeds gate value 1070 for chrome browserify home mean load
Benchmark value 1075 exceeds gate value 1061 for chrome browserify home mean domContentLoaded
Benchmark value 213 exceeds gate value 10 for chrome browserify home mean backgroundConnect
Benchmark value 3 exceeds gate value 1 for chrome browserify home mean initialActions
Benchmark value 869 exceeds gate value 830 for chrome browserify home mean loadScripts
Benchmark value 231 exceeds gate value 18 for chrome browserify home p95 backgroundConnect
Benchmark value 14 exceeds gate value 1.2 for chrome browserify home p95 initialActions
Benchmark value 943 exceeds gate value 940 for chrome browserify home p95 loadScripts
Benchmark value 2420 exceeds gate value 2192 for chrome webpack home mean uiStartup
Benchmark value 1920 exceeds gate value 1711 for chrome webpack home mean load
Benchmark value 1913 exceeds gate value 1704 for chrome webpack home mean domContentLoaded
Benchmark value 42 exceeds gate value 40 for chrome webpack home mean backgroundConnect
Benchmark value 12 exceeds gate value 7 for chrome webpack home mean initialActions
Benchmark value 1908 exceeds gate value 1699 for chrome webpack home mean loadScripts
Benchmark value 2617 exceeds gate value 2454 for chrome webpack home p95 uiStartup
Benchmark value 2187 exceeds gate value 2030 for chrome webpack home p95 load
Benchmark value 2183 exceeds gate value 2005 for chrome webpack home p95 domContentLoaded
Benchmark value 72 exceeds gate value 57 for chrome webpack home p95 domInteractive
Benchmark value 276 exceeds gate value 90 for chrome webpack home p95 backgroundConnect
Benchmark value 37 exceeds gate value 7 for chrome webpack home p95 initialActions
Benchmark value 2177 exceeds gate value 1970 for chrome webpack home p95 loadScripts
Benchmark value 1487 exceeds gate value 1405 for firefox browserify home mean uiStartup
Benchmark value 1284 exceeds gate value 1245 for firefox browserify home mean load
Benchmark value 1283 exceeds gate value 1239 for firefox browserify home mean domContentLoaded
Benchmark value 111 exceeds gate value 110 for firefox browserify home mean domInteractive
Benchmark value 26 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 16 exceeds gate value 11 for firefox browserify home mean getState
Benchmark value 4 exceeds gate value 1 for firefox browserify home mean initialActions
Benchmark value 1262 exceeds gate value 1230 for firefox browserify home mean loadScripts
Benchmark value 1787 exceeds gate value 1660 for firefox browserify home p95 uiStartup
Benchmark value 303 exceeds gate value 195 for firefox browserify home p95 domInteractive
Benchmark value 57 exceeds gate value 55 for firefox browserify home p95 firstReactRender
Benchmark value 92 exceeds gate value 24 for firefox browserify home p95 getState
Benchmark value 13 exceeds gate value 2 for firefox browserify home p95 initialActions
Benchmark value 1780 exceeds gate value 1615 for firefox webpack home mean uiStartup
Benchmark value 1494 exceeds gate value 1380 for firefox webpack home mean load
Benchmark value 1494 exceeds gate value 1380 for firefox webpack home mean domContentLoaded
Benchmark value 30 exceeds gate value 26 for firefox webpack home mean backgroundConnect
Benchmark value 54 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 1470 exceeds gate value 1360 for firefox webpack home mean loadScripts
Benchmark value 22 exceeds gate value 13 for firefox webpack home mean setupStore
Benchmark value 2150 exceeds gate value 1935 for firefox webpack home p95 uiStartup
Benchmark value 1805 exceeds gate value 1660 for firefox webpack home p95 load
Benchmark value 1804 exceeds gate value 1660 for firefox webpack home p95 domContentLoaded
Benchmark value 323 exceeds gate value 156 for firefox webpack home p95 domInteractive
Benchmark value 59 exceeds gate value 49 for firefox webpack home p95 backgroundConnect
Benchmark value 66 exceeds gate value 50 for firefox webpack home p95 firstReactRender
Benchmark value 37 exceeds gate value 32 for firefox webpack home p95 getState
Benchmark value 17 exceeds gate value 2 for firefox webpack home p95 initialActions
Benchmark value 1763 exceeds gate value 1630 for firefox webpack home p95 loadScripts
Benchmark value 124 exceeds gate value 28 for firefox webpack home p95 setupStore
Sum of mean exceeds: 1912ms | Sum of p95 exceeds: 2426.8ms
Sum of all benchmark exceeds: 4338.8ms

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

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: Hook Filters Out Non-Featured Networks

The useEnableMissingNetwork hook unintentionally disables previously enabled non-featured networks. It retrieves all currently enabled network keys across all namespaces, then filters them to include only EVM-specific FEATURED_NETWORK_CHAIN_IDS. This filtered list, which excludes any custom or non-featured networks, is then used to update the enabled networks for a specific namespace. This process removes any previously enabled non-featured networks and can lead to incorrect network mixing or accidental disabling of networks from other namespaces if their IDs overlap with featured EVM chain IDs.

ui/pages/bridge/prepare/prepare-bridge-page.tsx#L151-L173

(chainId: Hex) => {
const enabledNetworkKeys = Object.keys(enabledNetworksByNamespace ?? {});
const caipChainId = formatChainIdToCaip(chainId);
const { namespace } = parseCaipChainId(caipChainId);
if (namespace) {
const isPopularNetwork = FEATURED_NETWORK_CHAIN_IDS.includes(chainId);
if (isPopularNetwork) {
const isNetworkEnabled = enabledNetworkKeys.includes(chainId);
if (!isNetworkEnabled) {
const enabledEvmNetworks = enabledNetworkKeys.filter((key) =>
FEATURED_NETWORK_CHAIN_IDS.includes(key as Hex),
);
const newNetworkEnabledEvmNetworks = [
chainId,
...enabledEvmNetworks,
];
dispatch(
setEnabledNetworks(newNetworkEnabledEvmNetworks, namespace),
);
}

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

@metamaskbot
Copy link
Collaborator

Builds ready [5fdc6e4]
UI Startup Metrics (1290 ± 58 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1290115014425813251378
load110695612495611471188
domContentLoaded109795212385611401180
domInteractive19144981741
firstPaint65778121544611141185
backgroundConnect21520132813218229
firstReactRender22144872239
getState1034071225
initialActions30667313
loadScripts890748102955933974
setupStore74253712
WebpackHomeuiStartup24051936260513124932561
load19111407223515820122161
domContentLoaded19021401223015820052152
domInteractive2012223241560
firstPaint1566344074172326
backgroundConnect39112875831265
firstReactRender1738940476202339
getState134217211426
initialActions11218330729
loadScripts18951397222815619982148
setupStore156202201627
FirefoxBrowserifyHomeuiStartup14381295185612314571738
load1249113015128512891462
domContentLoaded1248112915118512881462
domInteractive1063057280100303
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect261591122648
firstReactRender27206392956
getState838311620
initialActions5018819222
loadScripts1228111214908412701440
setupStore10318320633
WebpackHomeuiStartup17331507235516618052062
load14751298176912315651718
domContentLoaded14741297176812315651718
domInteractive100353306195288
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect281876123060
firstReactRender50406855358
getState9288111028
initialActions7117718821
loadScripts14531279173712115401689
setupStore174234371089
Benchmark value 1290 exceeds gate value 1234 for chrome browserify home mean uiStartup
Benchmark value 1106 exceeds gate value 1070 for chrome browserify home mean load
Benchmark value 1098 exceeds gate value 1061 for chrome browserify home mean domContentLoaded
Benchmark value 216 exceeds gate value 10 for chrome browserify home mean backgroundConnect
Benchmark value 4 exceeds gate value 1 for chrome browserify home mean initialActions
Benchmark value 890 exceeds gate value 830 for chrome browserify home mean loadScripts
Benchmark value 1378 exceeds gate value 1365 for chrome browserify home p95 uiStartup
Benchmark value 1185 exceeds gate value 1180 for chrome browserify home p95 firstPaint
Benchmark value 230 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 975 exceeds gate value 940 for chrome browserify home p95 loadScripts
Benchmark value 2405 exceeds gate value 2192 for chrome webpack home mean uiStartup
Benchmark value 1912 exceeds gate value 1711 for chrome webpack home mean load
Benchmark value 1903 exceeds gate value 1704 for chrome webpack home mean domContentLoaded
Benchmark value 12 exceeds gate value 7 for chrome webpack home mean initialActions
Benchmark value 1896 exceeds gate value 1699 for chrome webpack home mean loadScripts
Benchmark value 2561 exceeds gate value 2454 for chrome webpack home p95 uiStartup
Benchmark value 2162 exceeds gate value 2030 for chrome webpack home p95 load
Benchmark value 2152 exceeds gate value 2005 for chrome webpack home p95 domContentLoaded
Benchmark value 60 exceeds gate value 57 for chrome webpack home p95 domInteractive
Benchmark value 265 exceeds gate value 90 for chrome webpack home p95 backgroundConnect
Benchmark value 29 exceeds gate value 7 for chrome webpack home p95 initialActions
Benchmark value 2148 exceeds gate value 1970 for chrome webpack home p95 loadScripts
Benchmark value 1439 exceeds gate value 1405 for firefox browserify home mean uiStartup
Benchmark value 1249 exceeds gate value 1245 for firefox browserify home mean load
Benchmark value 1249 exceeds gate value 1239 for firefox browserify home mean domContentLoaded
Benchmark value 26 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 6 exceeds gate value 1 for firefox browserify home mean initialActions
Benchmark value 10 exceeds gate value 9 for firefox browserify home mean setupStore
Benchmark value 1738 exceeds gate value 1660 for firefox browserify home p95 uiStartup
Benchmark value 303 exceeds gate value 195 for firefox browserify home p95 domInteractive
Benchmark value 56 exceeds gate value 55 for firefox browserify home p95 firstReactRender
Benchmark value 22 exceeds gate value 2 for firefox browserify home p95 initialActions
Benchmark value 33 exceeds gate value 27 for firefox browserify home p95 setupStore
Benchmark value 1734 exceeds gate value 1615 for firefox webpack home mean uiStartup
Benchmark value 1475 exceeds gate value 1380 for firefox webpack home mean load
Benchmark value 1475 exceeds gate value 1380 for firefox webpack home mean domContentLoaded
Benchmark value 101 exceeds gate value 100 for firefox webpack home mean domInteractive
Benchmark value 29 exceeds gate value 26 for firefox webpack home mean backgroundConnect
Benchmark value 50 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 1453 exceeds gate value 1360 for firefox webpack home mean loadScripts
Benchmark value 18 exceeds gate value 13 for firefox webpack home mean setupStore
Benchmark value 2062 exceeds gate value 1935 for firefox webpack home p95 uiStartup
Benchmark value 1718 exceeds gate value 1660 for firefox webpack home p95 load
Benchmark value 1718 exceeds gate value 1660 for firefox webpack home p95 domContentLoaded
Benchmark value 288 exceeds gate value 156 for firefox webpack home p95 domInteractive
Benchmark value 60 exceeds gate value 49 for firefox webpack home p95 backgroundConnect
Benchmark value 58 exceeds gate value 50 for firefox webpack home p95 firstReactRender
Benchmark value 21 exceeds gate value 2 for firefox webpack home p95 initialActions
Benchmark value 1689 exceeds gate value 1630 for firefox webpack home p95 loadScripts
Benchmark value 89 exceeds gate value 28 for firefox webpack home p95 setupStore
Sum of mean exceeds: 1700ms | Sum of p95 exceeds: 1786.8ms
Sum of all benchmark exceeds: 3486.8ms

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

Copy link
Contributor Author

@Prithpal-Sooriya Prithpal-Sooriya left a comment

Choose a reason for hiding this comment

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

LGTM

@HowardBraham HowardBraham added this pull request to the merge queue Jul 21, 2025
Merged via the queue into main with commit 2aef330 Jul 21, 2025
400 of 405 checks passed
@HowardBraham HowardBraham deleted the fix/enable-deselected-network-in-swap-bridge-flow branch July 21, 2025 05:32
@metamaskbot metamaskbot added the release-13.1.0 Issue or pull request that will be included in release 13.1.0 label Jul 21, 2025
runway-github bot added a commit that referenced this pull request Jul 21, 2025
…ming swap/bridge. (#34376)

## **Description**

TDB

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/34376?quickstart=1)

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry:

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->


https://www.loom.com/share/5383890221bf459f89f1138e59077c1f?sid=d0d480a4-5949-4b54-b37f-df449a178e30

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] 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](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
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.

---------

Co-authored-by: salimtb <[email protected]>
runway-github bot added a commit that referenced this pull request Jul 21, 2025
…ming swap/bridge. (#34376)

## **Description**

TDB

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/34376?quickstart=1)

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry:

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

https://www.loom.com/share/5383890221bf459f89f1138e59077c1f?sid=d0d480a4-5949-4b54-b37f-df449a178e30

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] 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](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
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.

---------

Co-authored-by: salimtb <[email protected]>
runway-github bot pushed a commit that referenced this pull request Jul 21, 2025
…ing networks when performing swap/bridge. (#34376)

## **Description**

TDB

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/34376?quickstart=1)

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry:

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->


https://www.loom.com/share/5383890221bf459f89f1138e59077c1f?sid=d0d480a4-5949-4b54-b37f-df449a178e30

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] 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](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
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.

---------

Co-authored-by: salimtb <[email protected]>
salimtb added a commit that referenced this pull request Jul 21, 2025
…swap/bridge. (#34376)

## **Description**

TDB

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/34376?quickstart=1)

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry:

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->


https://www.loom.com/share/5383890221bf459f89f1138e59077c1f?sid=d0d480a4-5949-4b54-b37f-df449a178e30

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] 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](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
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.

---------

Co-authored-by: salimtb <[email protected]>
DDDDDanica pushed a commit that referenced this pull request Jul 22, 2025
…ing networks when performing swap/bridge. (#34432)

- fix: cp-13.0.0 ensure we enable any missing networks when performing
swap/bridge. (#34376)

## **Description**

TDB

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

[![Open in GitHub

Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/34376?quickstart=1)

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry:

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->



https://www.loom.com/share/5383890221bf459f89f1138e59077c1f?sid=d0d480a4-5949-4b54-b37f-df449a178e30

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding

Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] 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](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling

guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
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.

---------

Co-authored-by: salimtb <[email protected]>
[2aef330](2aef330)

Co-authored-by: Prithpal Sooriya <[email protected]>
Co-authored-by: salimtb <[email protected]>
@gauthierpetetin gauthierpetetin added release-13.0.0 Issue or pull request that will be included in release 13.0.0 (also called 12.24.0) and removed release-13.1.0 Issue or pull request that will be included in release 13.1.0 labels Aug 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-13.0.0 Issue or pull request that will be included in release 13.0.0 (also called 12.24.0) team-assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants