Skip to content

Conversation

@OGPoyraz
Copy link
Member

@OGPoyraz OGPoyraz commented Nov 4, 2025

Description

This PR aims to fix a bug where token shows as unknown when network manager is selected nonEVM network.

Open in GitHub Codespaces

Changelog

CHANGELOG entry: null

Related issues

Fixes: #37428

Manual testing steps

  1. Select nonEVM network (Solana / BTC)
  2. Go to send flow
  3. Pick an ERC20 token (especially not on mainnet)
  4. Proceed send
  5. You should be able to see token name and image in confirmation

Screenshots/Recordings

Before

After

fix.recording.mov

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 token resolution in confirmations to use chain-scoped selectors with fallbacks and updates tests for presence/absence cases.

  • Confirmations UI:
    • Hook useTokenDetails:
      • Switches to chain-scoped selectors selectERC20TokensByChain and getAllTokens to resolve token details.
      • Derives erc20Token from erc20TokensByChain[chainId].data[to]; falls back to allTokens[chainId][from] lookup; returns t('unknown') when absent.
      • Removes reliance on getWatchedToken/getTokenList.
    • Tests useTokenDetails.test.ts:
      • Updated mocks to new chain-scoped token map shape.
      • Adds/updates cases for token present and for missing token/chain/address returning { tokenImage: undefined, tokenSymbol: 'Unknown' }.

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

@OGPoyraz OGPoyraz requested a review from a team as a code owner November 4, 2025 09:26
@metamaskbot metamaskbot added the team-confirmations Push issues to confirmations team label Nov 4, 2025
@metamaskbot
Copy link
Collaborator

metamaskbot commented Nov 4, 2025

✨ Files requiring CODEOWNER review ✨

@MetaMask/confirmations (2 files, +67 -105)
  • 📁 ui/
    • 📁 pages/
      • 📁 confirmations/
        • 📁 components/
          • 📁 confirm/
            • 📁 info/
              • 📁 hooks/
                • 📄 useTokenDetails.test.ts +48 -92
                • 📄 useTokenDetails.ts +19 -13

@github-actions github-actions bot added the size-M label Nov 4, 2025
cursor[bot]

This comment was marked as outdated.

vinistevam
vinistevam previously approved these changes Nov 4, 2025
jpuri
jpuri previously approved these changes Nov 4, 2025
cursor[bot]

This comment was marked as outdated.

@metamaskbot
Copy link
Collaborator

Builds ready [c825b20]
UI Startup Metrics (1246 ± 86 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1246108914578613011418
load106893312827911351194
domContentLoaded106190612748011301189
domInteractive211488131852
firstPaint63382128142710491183
backgroundConnect23321933112236247
firstReactRender26195372743
getState227100122539
initialActions61517716
loadScripts836670105779909965
setupStore1162231217
numNetworkReqs1367519672
BrowserifyPower User HomeuiStartup20071770271732824652717
load1026887134718313371347
domContentLoaded1018882133418113271334
domInteractive281584214284
firstPaint5838813694369311369
backgroundConnect23621826615248266
firstReactRender27243022830
getState17515523018188230
initialActions52133813
loadScripts794669109717410921097
setupStore1192741227
numNetworkReqs16710131287293312
WebpackStandard HomeuiStartup8176901154868291038
load59654893374589803
domContentLoaded58954391171582787
domInteractive16115981436
firstPaint18855914185189713
backgroundConnect241162122654
firstReactRender29186983338
getState1061621214
initialActions4036559
loadScripts58654189968580776
setupStore1162231218
numNetworkReqs1367419871
WebpackPower User HomeuiStartup13281120187525216111875
load66256410231428361023
domContentLoaded638554980125777980
domInteractive27131212834121
firstPaint36080816232570816
backgroundConnect701724374161243
firstReactRender26233222632
getState14810918820157188
initialActions41134413
loadScripts633552968121766968
setupStore1462772427
numNetworkReqs18410127765248277
FirefoxBrowserifyStandard HomeuiStartup15501273196411816071756
load1312110214998713851465
domContentLoaded1311110114998713851465
domInteractive1233639453130229
firstPaint------
backgroundConnect49251452451123
firstReactRender27225252841
getState9418218817
initialActions42163512
loadScripts1281108114618413481418
setupStore1476081533
numNetworkReqs1266315759
BrowserifyPower User HomeuiStartup26152193362546331073625
load14291155196924416921969
domContentLoaded14281154196824416921968
domInteractive23183671203476671
firstPaint------
backgroundConnect12334444121246444
firstReactRender44316085260
getState13910619024147190
initialActions9138101638
loadScripts13951133192923516511929
setupStore4361795162179
numNetworkReqs15268346101232346
WebpackStandard HomeuiStartup15651396214615915971989
load13361187168611013851596
domContentLoaded13361186168611013851595
domInteractive983129138113160
firstPaint------
backgroundConnect51252113256116
firstReactRender27217392736
getState9318319716
initialActions51326425
loadScripts1303117016019413491511
setupStore16587171470
numNetworkReqs1367318769
WebpackPower User HomeuiStartup25852203354732228123547
load15501278184517717531845
domContentLoaded15501278184417717531844
domInteractive18148450125302450
firstPaint------
backgroundConnect933328575129285
firstReactRender443071125071
getState1517824950196249
initialActions2811785019178
loadScripts15191255180616917051806
setupStore30682213882
numNetworkReqs1586632380249323
📊 Page Load Benchmark Results

Current Commit: c825b20 | Date: 11/4/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.02s (±38ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 712ms (±36ms) 🟢 | historical mean value: 726ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 74ms (±10ms) 🟢 | historical mean value: 80ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.02s 38ms 1.00s 1.32s 1.05s 1.32s
domContentLoaded 712ms 36ms 695ms 988ms 734ms 988ms
firstPaint 74ms 10ms 60ms 144ms 92ms 144ms
firstContentfulPaint 74ms 10ms 60ms 144ms 92ms 144ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 68 Bytes (0%)
  • ui: -127 Bytes (0%)
  • common: 10 Bytes (0%)

@OGPoyraz OGPoyraz enabled auto-merge November 4, 2025 15:19
@metamaskbot
Copy link
Collaborator

Builds ready [ce11e57]
UI Startup Metrics (1211 ± 83 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1211106514578312501398
load103291212297110731152
domContentLoaded102590612177010671144
domInteractive201372121757
firstPaint641113124140710301165
backgroundConnect2282142718231241
firstReactRender25174762638
getState20667102239
initialActions70658824
loadScripts80468899069846922
setupStore1063441117
numNetworkReqs1367119670
BrowserifyPower User HomeuiStartup19731768318034019793180
load1016897163618811251636
domContentLoaded1009892162118611151621
domInteractive241576152076
firstPaint752158163345911251633
backgroundConnect24122031422248314
firstReactRender28253532935
getState17415723519181235
initialActions51194819
loadScripts78267113211698971321
setupStore1081421214
numNetworkReqs14610130772234307
WebpackStandard HomeuiStartup8307021094888371063
load60555786074603828
domContentLoaded59855384371591817
domInteractive16126391439
firstPaint20560852193194744
backgroundConnect251274133057
firstReactRender29187793439
getState1153941215
initialActions4128449
loadScripts59455183369588806
setupStore1152941316
numNetworkReqs1367619869
WebpackPower User HomeuiStartup13251136194227215181942
load66756311481727991148
domContentLoaded65155210701597751070
domInteractive37121674943167
firstPaint3316811503045641150
backgroundConnect52103127588312
firstReactRender26243112631
getState14510915816155158
initialActions41165716
loadScripts64755010601557651060
setupStore16647122547
numNetworkReqs1439727966199279
FirefoxBrowserifyStandard HomeuiStartup14661273196611815081706
load12541084177510412941388
domContentLoaded12541084177510412941388
domInteractive1243439763129305
firstPaint------
backgroundConnect4326172204993
firstReactRender25214232629
getState8419119611
initialActions41445410
loadScripts12271066175210212661364
setupStore1264981231
numNetworkReqs1266615758
BrowserifyPower User HomeuiStartup24592185314129125513141
load13971183187019016061870
domContentLoaded13971183186918916051869
domInteractive22776770206328770
firstPaint------
backgroundConnect11131554127140554
firstReactRender453192165292
getState1218317928141179
initialActions11184201384
loadScripts13641148184418515301844
setupStore3791383855138
numNetworkReqs1377031272191312
WebpackStandard HomeuiStartup15961388209214316261956
load13561184167910014011574
domContentLoaded1356118416799914011573
domInteractive1003133740109177
firstPaint------
backgroundConnect49211462653117
firstReactRender29237872939
getState10413619720
initialActions51315414
loadScripts1327116815979013821516
setupStore177182211552
numNetworkReqs1266716863
WebpackPower User HomeuiStartup26892371345527428763455
load16291395195417317981954
domContentLoaded16281394195417317971954
domInteractive19047481138381481
firstPaint------
backgroundConnect932925568140255
firstReactRender46311072345107
getState1287720435170204
initialActions61256925
loadScripts15921366190416517621904
setupStore28772214572
numNetworkReqs1376632688200326
📊 Page Load Benchmark Results

Current Commit: ce11e57 | Date: 11/4/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±40ms) 🟡 | historical mean value: 1.03s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 716ms (±37ms) 🟢 | historical mean value: 718ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 76ms (±13ms) 🟢 | historical mean value: 79ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 40ms 1.00s 1.32s 1.06s 1.32s
domContentLoaded 716ms 37ms 694ms 991ms 743ms 991ms
firstPaint 76ms 13ms 60ms 188ms 88ms 188ms
firstContentfulPaint 76ms 13ms 60ms 188ms 88ms 188ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 68 Bytes (0%)
  • ui: -127 Bytes (0%)
  • common: 10 Bytes (0%)

@OGPoyraz OGPoyraz dismissed stale reviews from jpuri and vinistevam via 81e64cd November 5, 2025 08:40
@metamaskbot
Copy link
Collaborator

Builds ready [6e634c4]
UI Startup Metrics (1213 ± 86 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1213107214308612751374
load104292412198011031180
domContentLoaded103485712138210971165
domInteractive211477131856
firstPaint60772122741410171174
backgroundConnect23021733714231255
firstReactRender24175352533
getState2074582239
initialActions61708718
loadScripts81163499181878947
setupStore1062231114
numNetworkReqs1367620674
BrowserifyPower User HomeuiStartup20601794345443223203454
load1038896155520012421555
domContentLoaded1030889155019812371550
domInteractive321589245689
firstPaint73418313523859371352
backgroundConnect24622330922263309
firstReactRender27253322833
getState18215623019191230
initialActions72378637
loadScripts800667126818810181268
setupStore1692872728
numNetworkReqs17510437495290374
WebpackStandard HomeuiStartup8387171236958421088
load61255798182603852
domContentLoaded60455196178593825
domInteractive161165101446
firstPaint21159965208198756
backgroundConnect251071132759
firstReactRender28185173436
getState1051931215
initialActions30163410
loadScripts60154994976590814
setupStore1152331318
numNetworkReqs1367519872
WebpackPower User HomeuiStartup13121161185022713351850
load658575997128805997
domContentLoaded634563869101765869
domInteractive241279194379
firstPaint34963872291576872
backgroundConnect52101885867188
firstReactRender27254032740
getState1436516326159163
initialActions31256325
loadScripts62956185897752858
setupStore1463392533
numNetworkReqs1649928266233282
FirefoxBrowserifyStandard HomeuiStartup15191305210813215801736
load1285112515099213561465
domContentLoaded1285112515099213561465
domInteractive1223841249131217
firstPaint------
backgroundConnect50271542556118
firstReactRender27217572740
getState9418719717
initialActions42233412
loadScripts1253110614908513241398
setupStore157225221528
numNetworkReqs1266215860
BrowserifyPower User HomeuiStartup24392107318027025223180
load13561158164416315991644
domContentLoaded13561158164316315991643
domInteractive21385530160456530
firstPaint------
backgroundConnect12328441114200441
firstReactRender39304654546
getState1328020832155208
initialActions913291232
loadScripts13021091160516214301605
setupStore27581224381
numNetworkReqs1426833186222331
WebpackStandard HomeuiStartup16781513240815516981969
load1410127117058914501594
domContentLoaded1410127117058914501594
domInteractive1013618126114156
firstPaint------
backgroundConnect53251592657110
firstReactRender31247483141
getState10311117737
initialActions7118619431
loadScripts1377124216208214201537
setupStore187206231553
numNetworkReqs1366918765
WebpackPower User HomeuiStartup25802186334931327363349
load15311239202719416982027
domContentLoaded15301238202619416982026
domInteractive14438427103194427
firstPaint------
backgroundConnect1033136090142360
firstReactRender43315385153
getState1287419639175196
initialActions1318121881
loadScripts14871219197818016361978
setupStore4661734757173
numNetworkReqs1996734084252340
📊 Page Load Benchmark Results

Current Commit: 6e634c4 | Date: 11/5/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±39ms) 🟡 | historical mean value: 1.03s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 714ms (±37ms) 🟢 | historical mean value: 719ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 75ms (±10ms) 🟢 | historical mean value: 78ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 39ms 1.00s 1.33s 1.06s 1.33s
domContentLoaded 714ms 37ms 693ms 1.01s 737ms 1.01s
firstPaint 75ms 10ms 60ms 156ms 84ms 156ms
firstContentfulPaint 75ms 10ms 60ms 156ms 84ms 156ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 1.92 KiB (0.04%)
  • ui: 23.33 KiB (0.33%)
  • common: 1.33 KiB (0.02%)

@OGPoyraz OGPoyraz added this pull request to the merge queue Nov 5, 2025
Merged via the queue into main with commit 3045d76 Nov 5, 2025
173 checks passed
@OGPoyraz OGPoyraz deleted the ogp/37428 branch November 5, 2025 10:36
@github-actions github-actions bot locked and limited conversation to collaborators Nov 5, 2025
@metamaskbot metamaskbot added the release-13.9.0 Issue or pull request that will be included in release 13.9.0 label Nov 5, 2025
@gauthierpetetin
Copy link
Contributor

Hi @OGPoyraz , what would be the user-facing CHANGELOG entry for this PR?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.9.0 Issue or pull request that will be included in release 13.9.0 size-M team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Unknown asset in send transaction review screen, when the Network manager selection is Solana

6 participants