Skip to content

Conversation

@sahar-fehri
Copy link
Contributor

@sahar-fehri sahar-fehri commented Nov 27, 2025

Description

PR to add event tracing for hiding tokens from asset options

Open in GitHub Codespaces

Changelog

CHANGELOG entry: Adds event tracing for hide token.

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Adds MetaMetrics tracking for hiding a token and updates AssetOptions to use a token object instead of tokenSymbol, adjusting call sites accordingly.

  • Asset Options (ui/pages/asset/components/asset-options.js):
    • Track MetaMetricsEventName.TokenHidden on hide with token details (symbol, address, decimals, chain_id, etc.).
    • Replace tokenSymbol prop with token; update label to use token?.symbol and validate via propTypes.
    • Add handleRemoveToken to wrap hide action; integrate MetaMetricsContext and related constants.
  • Token Asset (ui/pages/asset/components/token-asset.tsx):
    • Pass full token to AssetOptions instead of tokenSymbol.

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

@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
Copy link
Collaborator

Builds ready [666c4df]
UI Startup Metrics (1275 ± 106 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup12751056152010613471480
load102485812098610831170
domContentLoaded101785211928610791159
domInteractive251595192179
firstPaint571129122639810181137
backgroundConnect21519425713222242
firstReactRender362478103858
getState63191753280137
initialActions108113
loadScripts80965498985863954
setupStore1463461826
numNetworkReqs41281443330139
BrowserifyPower User HomeuiStartup21071773286825922472597
load1020901149412610161367
domContentLoaded1005890148312610021358
domInteractive3418138243298
firstPaint5448814983959671273
backgroundConnect260203726114230624
firstReactRender5941108136489
getState19713675395195246
initialActions105112
loadScripts79869412721247921147
setupStore2096092442
numNetworkReqs1467139071195304
WebpackStandard HomeuiStartup86172611591048831138
load64257089479667842
domContentLoaded63756688578664836
domInteractive2715114232292
firstPaint21786842154198601
backgroundConnect1153971231
firstReactRender3821239273969
getState49161292563101
initialActions103112
loadScripts63456488276661826
setupStore147117121434
numNetworkReqs41281473430143
WebpackPower User HomeuiStartup17151292248225519612078
load6765841216108678947
domContentLoaded6675791211109668940
domInteractive37172123532131
firstPaint2691021006207248701
backgroundConnect1278625209109581
firstReactRender624496106785
getState18412770792181239
initialActions103112
loadScripts6645771202107665931
setupStore20859112345
numNetworkReqs1617040677202387
FirefoxBrowserifyStandard HomeuiStartup13811159219017314751713
load106792513399811491254
domContentLoaded106792513399811491254
domInteractive57311803279114
firstPaint------
backgroundConnect56292493560133
firstReactRender27188492943
getState2410147172243
initialActions2012123
loadScripts104391013239511221237
setupStore289222342291
numNetworkReqs39281292633119
BrowserifyPower User HomeuiStartup26881921530069626654545
load1151959274026611191473
domContentLoaded1150959274026611191473
domInteractive1133343398106398
firstPaint------
backgroundConnect154331165189143504
firstReactRender64363423763120
getState299331181230334791
initialActions2027323
loadScripts1096941227317910791428
setupStore22591043249407755
numNetworkReqs102623216481249
WebpackStandard HomeuiStartup17381413221517618532078
load13501113157610114301516
domContentLoaded13501113157610114301515
domInteractive78282764098140
firstPaint------
backgroundConnect72212303876167
firstReactRender3621158203862
getState2910245312684
initialActions205123
loadScripts1316109615189513701485
setupStore32112534025134
numNetworkReqs40281252639120
WebpackPower User HomeuiStartup29212093521571729414607
load13991189290833413411853
domContentLoaded13991189290833313401853
domInteractive1142953511798452
firstPaint------
backgroundConnect124291273170122257
firstReactRender71413243973149
getState29188980213350753
initialActions213123
loadScripts13421165280825613051774
setupStore14810801188152652
numNetworkReqs99593016079232
📊 Page Load Benchmark Results

Current Commit: 666c4df | Date: 11/27/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±122ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 734ms (±145ms) 🟢 | historical mean value: 723ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 96ms (±214ms) 🟢 | historical mean value: 78ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 122ms 1.00s 2.24s 1.08s 2.24s
domContentLoaded 734ms 145ms 695ms 2.16s 755ms 2.16s
firstPaint 96ms 214ms 60ms 2.22s 84ms 2.22s
firstContentfulPaint 96ms 214ms 60ms 2.22s 84ms 2.22s
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: 674 Bytes (0.01%)
  • common: 20 Bytes (0%)

token_contract_address: token?.address,
token_decimal_precision: token?.decimals,
location: MetaMetricsEventLocation.TokenDetails,
token_standard: TokenStandard.ERC20,
Copy link

Choose a reason for hiding this comment

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

Bug: Hardcoded ERC20 token standard ignores ERC721 tokens

The token_standard in the TokenHidden event is hardcoded as TokenStandard.ERC20, but the token object can also represent ERC721 tokens (it has an isERC721 property). When users hide an ERC721 token, the event will incorrectly report it as ERC20, causing inaccurate analytics data. The token standard could be determined dynamically using token?.isERC721 since TokenStandard.ERC721 is available in the same imported enum.

Fix in Cursor Fix in Web

@metamaskbot
Copy link
Collaborator

Builds ready [ff07f37]
UI Startup Metrics (1226 ± 125 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup12261004157312512951464
load99683612469910601185
domContentLoaded98983012369810541178
domInteractive2514106191976
firstPaint68994127940210271196
backgroundConnect19717624312203223
firstReactRender33226383648
getState5115139215891
initialActions104113
loadScripts799642103795847985
setupStore1363661526
numNetworkReqs41281473431143
BrowserifyPower User HomeuiStartup20221684278926220982611
load99787714731479871410
domContentLoaded98486714661469741397
domInteractive34161442733121
firstPaint6529314894089561381
backgroundConnect246188695105222530
firstReactRender5940107146488
getState19615064553206249
initialActions102012
loadScripts78767612591437801190
setupStore18106492039
numNetworkReqs1546840376195331
WebpackStandard HomeuiStartup85172114021088731097
load63356899383635839
domContentLoaded62856498683629832
domInteractive26141162322103
firstPaint21877992165204690
backgroundConnect1062951026
firstReactRender3820179253599
getState5018126236594
initialActions104113
loadScripts62556297681627822
setupStore15461101839
numNetworkReqs41291423330141
WebpackPower User HomeuiStartup16391273220224518872078
load676583106593676903
domContentLoaded667577105893667895
domInteractive38161943732141
firstPaint295861064214332845
backgroundConnect82757916220541
firstReactRender62478786679
getState1659024321173200
initialActions104112
loadScripts664575105091665886
setupStore1974892243
numNetworkReqs1256634667126320
FirefoxBrowserifyStandard HomeuiStartup14411199192316815591720
load1105960154011411981329
domContentLoaded1104954154011511981328
domInteractive65322023690137
firstPaint------
backgroundConnect70242695185175
firstReactRender291977103345
getState2411149162442
initialActions205123
loadScripts1072940146710211511241
setupStore2512144212260
numNetworkReqs39281252533116
BrowserifyPower User HomeuiStartup26531975498048427963626
load11851012251319211931512
domContentLoaded11841012251319211921512
domInteractive13046624110121438
firstPaint------
backgroundConnect152331921207137451
firstReactRender6036136186198
getState30166907221347776
initialActions203123
loadScripts1151987241718611581474
setupStore1716812192184674
numNetworkReqs101603016278243
WebpackStandard HomeuiStartup16761391214016717551989
load13241124165112513971581
domContentLoaded13231124165112513971581
domInteractive62271873593121
firstPaint------
backgroundConnect71192343788149
firstReactRender332098123758
getState2711188282586
initialActions205123
loadScripts12911108157911613721517
setupStore29102863526100
numNetworkReqs40281262737121
WebpackPower User HomeuiStartup29292134485369031154517
load14431170278934215532487
domContentLoaded14431170278834215532487
domInteractive1153261611995462
firstPaint------
backgroundConnect12033923108132301
firstReactRender61401771965100
getState291621743269414838
initialActions3166737
loadScripts13881117261729715192125
setupStore1369926177136627
numNetworkReqs101622566178248
📊 Page Load Benchmark Results

Current Commit: ff07f37 | Date: 11/27/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.01s (±51ms) 🟡 | historical mean value: 1.03s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 701ms (±74ms) 🟢 | historical mean value: 717ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 81ms (±52ms) 🟢 | historical mean value: 78ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.01s 51ms 983ms 1.45s 1.06s 1.45s
domContentLoaded 701ms 74ms 677ms 1.40s 715ms 1.40s
firstPaint 81ms 52ms 64ms 592ms 84ms 592ms
firstContentfulPaint 81ms 52ms 64ms 592ms 84ms 592ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: 674 Bytes (0.01%)
  • common: 20 Bytes (0%)

@metamaskbot
Copy link
Collaborator

Builds ready [247e105]
UI Startup Metrics (1144 ± 115 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1144945158611512231349
load96179513629710051130
domContentLoaded95478913569610001113
domInteractive2313102171970
firstPaint6448912213769801112
backgroundConnect18917523811193213
firstReactRender29176293447
getState3214116153953
initialActions103112
loadScripts772613117893812930
setupStore1163341320
numNetworkReqs1257921577
BrowserifyPower User HomeuiStartup20641706282525422202613
load1007879156913410061386
domContentLoaded99387315541349821376
domInteractive34181612932119
firstPaint6189215704179671381
backgroundConnect24019266692224603
firstReactRender6038132166596
getState18713327630207254
initialActions104112
loadScripts79168513571337861177
setupStore21875112440
numNetworkReqs1496839071200281
WebpackStandard HomeuiStartup816683120586835975
load637560103982663814
domContentLoaded633556103482659808
domInteractive2515103212088
firstPaint21497911157194641
backgroundConnect1154171130
firstReactRender26203953136
getState251364103342
initialActions104112
loadScripts629553103280656806
setupStore1062131218
numNetworkReqs1257520570
WebpackPower User HomeuiStartup16411259225024218752089
load67058793380688885
domContentLoaded66157892582680880
domInteractive34171492731111
firstPaint25789913180250741
backgroundConnect126871321353577
firstReactRender614397116879
getState1719624019182201
initialActions104112
loadScripts65857591780678872
setupStore23986142352
numNetworkReqs101662865299259
FirefoxBrowserifyStandard HomeuiStartup13591107178717214701693
load1103920144610911731302
domContentLoaded1103920144610911731302
domInteractive68291863791135
firstPaint------
backgroundConnect49221883161113
firstReactRender24185362439
getState146202221136
initialActions102112
loadScripts1073903142310311321279
setupStore165229271139
numNetworkReqs1156515658
BrowserifyPower User HomeuiStartup25612093449040926083447
load11631005230717911521527
domContentLoaded11631005230717911521527
domInteractive12338576110112401
firstPaint------
backgroundConnect1092849586108322
firstReactRender583694136190
getState25264880205292754
initialActions3170723
loadScripts1129986214616511231497
setupStore19112755209289707
numNetworkReqs101593226379241
WebpackStandard HomeuiStartup15331281202116716791840
load12531062152112313691511
domContentLoaded12531062152112313681511
domInteractive62271463085117
firstPaint------
backgroundConnect52162113160120
firstReactRender28198392940
getState2171993715121
initialActions103122
loadScripts12211047150011713241470
setupStore145124161443
numNetworkReqs1257217762
WebpackPower User HomeuiStartup29092159532565330944489
load14441181261533014622489
domContentLoaded14441181261533014622489
domInteractive1133252411797477
firstPaint------
backgroundConnect129281027153125261
firstReactRender66412683466129
getState324531073263524863
initialActions4058837
loadScripts13971160246628814312115
setupStore14671153207150623
numNetworkReqs100602535979242
📊 Page Load Benchmark Results

Current Commit: 247e105 | Date: 11/28/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±97ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 734ms (±121ms) 🟢 | historical mean value: 726ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 85ms (±103ms) 🟢 | historical mean value: 79ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 97ms 1.01s 1.97s 1.06s 1.97s
domContentLoaded 734ms 121ms 702ms 1.92s 750ms 1.92s
firstPaint 85ms 103ms 56ms 1.11s 84ms 1.11s
firstContentfulPaint 85ms 103ms 56ms 1.11s 84ms 1.11s
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: 674 Bytes (0.01%)
  • common: 20 Bytes (0%)

@sahar-fehri sahar-fehri added this pull request to the merge queue Nov 28, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 28, 2025
@salimtb salimtb added this pull request to the merge queue Nov 28, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 28, 2025
@salimtb salimtb enabled auto-merge November 28, 2025 13:24
@metamaskbot
Copy link
Collaborator

Builds ready [11e465c]
UI Startup Metrics (1274 ± 109 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup12741047153010913531471
load106187412959811291244
domContentLoaded105586912879711201234
domInteractive271697192381
firstPaint59492127743210621214
backgroundConnect22020126113227248
firstReactRender3420132143955
getState43171292254104
initialActions107113
loadScripts8416681063958971021
setupStore1363861525
numNetworkReqs1257620572
BrowserifyPower User HomeuiStartup20941698328026922582592
load1033904190514810261369
domContentLoaded1018895189314910211360
domInteractive35181902932110
firstPaint51810519133859591077
backgroundConnect24219871580228494
firstReactRender5739103126185
getState19313568976208250
initialActions104112
loadScripts81068116851478131147
setupStore19114062331
numNetworkReqs1536941077203311
WebpackStandard HomeuiStartup8316931263958551011
load646560106581674821
domContentLoaded642556106081670814
domInteractive2615147242094
firstPaint22883781156209679
backgroundConnect1052951026
firstReactRender26204363037
getState25135093441
initialActions105112
loadScripts639554105279668806
setupStore1061931116
numNetworkReqs1257720574
WebpackPower User HomeuiStartup17941323264928920752276
load7156111208108712981
domContentLoaded7056041201109699976
domInteractive40191823439130
firstPaint271110954159278658
backgroundConnect71761815920566
firstReactRender6747123137196
getState210137748120196665
initialActions103112
loadScripts7026021191108697967
setupStore221059112450
numNetworkReqs1746841879219387
FirefoxBrowserifyStandard HomeuiStartup16571285255723017852070
load13611112230317814181744
domContentLoaded13611112230317814181744
domInteractive823623637106148
firstPaint------
backgroundConnect67273404787156
firstReactRender27196862840
getState15782131439
initialActions103123
loadScripts13191093227016713781648
setupStore196255331290
numNetworkReqs1256617763
BrowserifyPower User HomeuiStartup26451978476738027563466
load12031038166615012111587
domContentLoaded12021037166615012111587
domInteractive13050581114116469
firstPaint------
backgroundConnect1132958586124349
firstReactRender61401401863107
getState29568859223375809
initialActions2132337
loadScripts11701017159514811691555
setupStore18416768199251622
numNetworkReqs101613326578240
WebpackStandard HomeuiStartup14841293197513315361742
load1226105514998612831393
domContentLoaded1226105514998612821393
domInteractive60251853282116
firstPaint------
backgroundConnect44201852743102
firstReactRender292187122867
getState157149201350
initialActions103122
loadScripts1201103314147812591345
setupStore14573141346
numNetworkReqs1257116765
WebpackPower User HomeuiStartup29122090492469429954463
load14421181281239714352642
domContentLoaded14421181281239714352642
domInteractive1052949211192451
firstPaint------
backgroundConnect136251097154154288
firstReactRender62392732960105
getState307661044238466843
initialActions2133326
loadScripts13801149263633513662450
setupStore15651250230150690
numNetworkReqs99612496079240
📊 Page Load Benchmark Results

Current Commit: 11e465c | Date: 11/28/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±38ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 721ms (±36ms) 🟢 | historical mean value: 728ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 77ms (±10ms) 🟢 | historical mean value: 78ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 38ms 1.01s 1.33s 1.06s 1.33s
domContentLoaded 721ms 36ms 702ms 999ms 744ms 999ms
firstPaint 77ms 10ms 60ms 156ms 92ms 156ms
firstContentfulPaint 77ms 10ms 60ms 156ms 92ms 156ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: 674 Bytes (0.01%)
  • common: 20 Bytes (0%)

@salimtb salimtb added this pull request to the merge queue Nov 28, 2025
Merged via the queue into main with commit 2f61222 Nov 28, 2025
176 checks passed
@salimtb salimtb deleted the chore/add-tracing-for-hide-token branch November 28, 2025 14:15
@github-actions github-actions bot locked and limited conversation to collaborators Nov 28, 2025
@metamaskbot metamaskbot added the release-13.13.0 Issue or pull request that will be included in release 13.13.0 label Nov 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.13.0 Issue or pull request that will be included in release 13.13.0 size-S team-assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants