Skip to content

Conversation

PatrykLucka
Copy link
Contributor

@PatrykLucka PatrykLucka commented Oct 15, 2025

Description

This PR fixes issue with the DaPP permissions icon showing wrong network for Solana only DaPP.

Changelog

CHANGELOG entry: Fixed a bug with the DaPP permissions icon showing wrong network for Solana only DaPP

Related issues

Fixes: #36825

Manual testing steps

  1. Navigate to SOL only dapp (Orca, Jupiter)
  2. Connect to DaPP
  3. Notice Badge icon

Screenshots/Recordings

Before

Screenshot 2025-10-15 at 16 37 41

After

Screenshot 2025-10-15 at 16 35 33

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

Refactors active network detection to be multichain-aware (EVM and Solana) via a selector, updates the connected site popover to use it, adds safeguards, and adjusts/extends tests and fixtures.

  • Selectors:
    • getDappActiveNetwork: Derives active network from ordered connected accounts; supports EVM and non‑EVM (Solana) via scopes; returns { ...network, isEvm }; uses getMultichainNetworkConfigurationsByChainId.
    • Adds use of getOrderedConnectedAccountsForActiveTab; updates tests for new logic.
    • getMetaMaskAccountsOrdered: Safeguards spreading when address missing.
  • UI:
    • ConnectedSitePopover: Replaces manual domain-based lookup with getDappActiveNetwork; removes useMemo and unused selectors.
  • Tests:
    • New/updated tests for selector (ui/selectors/dapp.test.ts) covering EVM, Solana, and null paths.
    • Updates to popover/menu/routes tests to include required state (domains, selectedNetworkClientId, keyrings.metadata, internalAccounts, permissionHistory, multichain configs/accounts).
  • Test data:
    • Extend fixtures with additional accounts/addresses and keyring metadata in mock-send-state.json and onboarding data.

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

@PatrykLucka PatrykLucka self-assigned this Oct 15, 2025
@PatrykLucka PatrykLucka added the team-mobile-ux Mobile UX team label Oct 15, 2025
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
Copy link
Collaborator

metamaskbot commented Oct 15, 2025

✨ Files requiring CODEOWNER review ✨

👨‍🔧 @MetaMask/core-extension-ux (3 files, +64 -32)
  • 📁 ui/
    • 📁 components/
      • 📁 multichain/
        • 📁 connected-site-menu/
          • 📄 connected-site-menu.test.js +24 -1
        • 📁 connected-site-popover/
          • 📄 connected-site-popover.test.tsx +36 -0
          • 📄 connected-site-popover.tsx +4 -31

@metamaskbot
Copy link
Collaborator

📊 Page Load Benchmark Results

Current Commit: 3abb653 | Date: 10/15/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.06s (±70ms) 🟡 | historical mean value: 1.06s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 742ms (±68ms) 🟢 | historical mean value: 741ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 78ms (±13ms) 🟢 | historical mean value: 78ms ⬆️ (historical data)
📈 Detailed Results
Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.06s 70ms 1.02s 1.35s 1.26s 1.35s
domContentLoaded 742ms 68ms 707ms 1.01s 942ms 1.01s
firstPaint 78ms 13ms 60ms 196ms 88ms 196ms
firstContentfulPaint 78ms 13ms 60ms 196ms 88ms 196ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Results generated automatically by MetaMask CI

@metamaskbot
Copy link
Collaborator

Builds ready [3abb653]
UI Startup Metrics (1238 ± 74 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1238110616057412761360
load105895413966910941169
domContentLoaded105294813816810861164
domInteractive181395101739
firstPaint72797117542310851146
backgroundConnect2492362818253265
firstReactRender2818127122946
getState14586111626
initialActions50325613
loadScripts809694112667843921
setupStore1053141120
WebpackHomeuiStartup8377201167748491024
load63158296272641867
domContentLoaded62357595371631845
domInteractive15114671435
firstPaint19257963191193725
backgroundConnect21114962532
firstReactRender27165073236
getState941931113
initialActions3011246
loadScripts62057494268630834
setupStore1061731213
FirefoxBrowserifyHomeuiStartup14351239188311614991716
load1206105813607812791331
domContentLoaded1206105813607812791331
domInteractive993328247105230
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect32236083552
firstReactRender29255953135
getState10412615820
initialActions6220121313
loadScripts1185104313357712541311
setupStore12670121051
WebpackHomeuiStartup15611364205411915861868
load1328118616427913611507
domContentLoaded1328118616427913611507
domInteractive973142560101160
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect341991133968
firstReactRender33268083441
getState11410716928
initialActions41617315
loadScripts1305116915677613371484
setupStore146213231037
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 1.22 KiB (0.03%)
  • ui: 90 Bytes (0%)
  • common: 8.08 KiB (0.1%)

@PatrykLucka PatrykLucka force-pushed the fix-permissions-network-on-solana-dapp branch from 3abb653 to 1255491 Compare October 15, 2025 13:10
@metamaskbot
Copy link
Collaborator

📊 Page Load Benchmark Results

Current Commit: 3f10837 | Date: 10/15/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±68ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 716ms (±66ms) 🟢 | historical mean value: 740ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 75ms (±9ms) 🟢 | historical mean value: 78ms ⬇️ (historical data)
📈 Detailed Results
Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 68ms 1.01s 1.31s 1.25s 1.31s
domContentLoaded 716ms 66ms 684ms 980ms 924ms 980ms
firstPaint 75ms 9ms 60ms 144ms 84ms 144ms
firstContentfulPaint 75ms 9ms 60ms 144ms 84ms 144ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Results generated automatically by MetaMask CI

@metamaskbot
Copy link
Collaborator

Builds ready [3f10837]
UI Startup Metrics (1247 ± 68 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1247110914626812901363
load107096512626511111185
domContentLoaded106496212496411061176
domInteractive18135471738
firstPaint63782119842910681170
backgroundConnect2502372918254265
firstReactRender26194762740
getState1566981827
initialActions40274612
loadScripts82071598963862932
setupStore962831018
WebpackHomeuiStartup8407141362928481030
load633580118789634857
domContentLoaded626574117988626846
domInteractive16116791437
firstPaint16757937165179599
backgroundConnect21115072532
firstReactRender27168193234
getState931631113
initialActions3010246
loadScripts623572116886624835
setupStore1053641213
FirefoxBrowserifyHomeuiStartup1383122517659914311567
load1168104513587312171333
domContentLoaded1168104513567312171332
domInteractive963335544100204
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect3322105113754
firstReactRender28245762938
getState85626813
initialActions4146538
loadScripts1146102713407111941275
setupStore116170161017
WebpackHomeuiStartup15971395214212516381830
load1358121115917814061502
domContentLoaded1357121115907814061502
domInteractive983134653106175
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect3721155184066
firstReactRender352782103651
getState103133141026
initialActions51648414
loadScripts1333119315507313811473
setupStore166230261266
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 1.64 KiB (0.04%)
  • ui: 1.6 KiB (0.02%)
  • common: 9.31 KiB (0.11%)

@metamaskbot
Copy link
Collaborator

📊 Page Load Benchmark Results

Current Commit: 98c125e | Date: 10/15/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±70ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 727ms (±68ms) 🟢 | historical mean value: 738ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 75ms (±11ms) 🟢 | historical mean value: 78ms ⬇️ (historical data)
📈 Detailed Results
Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 70ms 1.00s 1.31s 1.25s 1.31s
domContentLoaded 727ms 68ms 694ms 994ms 935ms 994ms
firstPaint 75ms 11ms 60ms 172ms 84ms 172ms
firstContentfulPaint 75ms 11ms 60ms 172ms 84ms 172ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Results generated automatically by MetaMask CI

@metamaskbot
Copy link
Collaborator

Builds ready [98c125e]
UI Startup Metrics (1260 ± 74 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1260111715197413091393
load108296612826811321211
domContentLoaded107696112776811251206
domInteractive17144151735
firstPaint708117128743111001164
backgroundConnect2542412827258266
firstReactRender27195862940
getState1554071931
initialActions51476715
loadScripts828718102065873951
setupStore1163151324
WebpackHomeuiStartup818702108258833920
load61957092060632745
domContentLoaded61156589658623727
domInteractive15115071334
firstPaint18054764165194589
backgroundConnect2194772531
firstReactRender26163663133
getState931431113
initialActions307246
loadScripts60956388656621716
setupStore951421113
FirefoxBrowserifyHomeuiStartup14251220178711714821697
load1195103614618912551348
domContentLoaded1195103614608912551348
domInteractive1003327449105236
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect3720304313880
firstReactRender29255643037
getState85335817
initialActions51647414
loadScripts1170101814008312191322
setupStore146137201051
WebpackHomeuiStartup15931418215613416541875
load13621201174810014481520
domContentLoaded13621200174710014481520
domInteractive1013151872108322
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect381999164280
firstReactRender342683123477
getState95646915
initialActions51517315
loadScripts1337118417219514151494
setupStore146247251038
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 1.64 KiB (0.04%)
  • ui: 2.52 KiB (0.04%)
  • common: 9.34 KiB (0.11%)

@PatrykLucka PatrykLucka marked this pull request as ready for review October 15, 2025 14:38
@PatrykLucka PatrykLucka requested a review from a team as a code owner October 15, 2025 14:38
@PatrykLucka PatrykLucka changed the title fix: multichain support on dapp connected site popover fix: multichain support on dapp connected site popover cp-13.5.0 Oct 15, 2025
@adonesky1
Copy link
Contributor

Just checked and on main requesting via the solana wallet standard only gets a solana scope permission

Screen.Recording.2025-10-15.at.3.23.54.PM.mov

But on your PR we're getting all EVM chains as well:

Screen.Recording.2025-10-15.at.3.28.19.PM.mov

so there is a regression. It seems the regression in the other direction (request via EVM provider and get EVM plus Solana) is already on main

@PatrykLucka
Copy link
Contributor Author

@adonesky1 Thank you for testing it carefully! 🙏 I just tested it again and it is working correctly, I'm pretty sure the reason it was not working correctly for you is because of the E2E Test Dapp using the same domain as solana test dapp. I saw on your video when you switched tab just for a moment (very helpful mistake! haha) you were already connected to the EVM network on E2E Test Dapp, so this is the reason why EVM networks were included in the Solana Dapp request. I was able to reproduce the same behaviour on main

@PatrykLucka PatrykLucka added this pull request to the merge queue Oct 16, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 16, 2025
@PatrykLucka PatrykLucka added this pull request to the merge queue Oct 16, 2025
Merged via the queue into main with commit 2be8ec5 Oct 16, 2025
180 checks passed
@PatrykLucka PatrykLucka deleted the fix-permissions-network-on-solana-dapp branch October 16, 2025 14:53
@github-actions github-actions bot locked and limited conversation to collaborators Oct 16, 2025
@metamaskbot metamaskbot added the release-13.6.0 Issue or pull request that will be included in release 13.6.0 label Oct 16, 2025
@gauthierpetetin gauthierpetetin added release-13.5.0 Issue or pull request that will be included in release 13.5.0 and removed release-13.6.0 Issue or pull request that will be included in release 13.6.0 labels Oct 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.5.0 Issue or pull request that will be included in release 13.5.0 size-M team-mobile-ux Mobile UX team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Permissions showing incorrect network on Solana only DaPPs

6 participants