Skip to content

Conversation

@montelaidev
Copy link
Contributor

@montelaidev montelaidev commented Jan 20, 2026

Description

This is the 6th of 11 prs to introduce system for handling hardware wallet connections in MetaMask. It manages the connection lifecycle, permission handling, error states, and provides a clean interface for UI components to interact with hardware wallets.

This PR adds the hardware error provider that will be responsible for displaying the preflight errors.

Depends on:

Open in GitHub Codespaces

Changelog

CHANGELOG entry: null

Related issues

Related to: https://consensyssoftware.atlassian.net/browse/MUL-1299?atlOrigin=eyJpIjoiZWZlYjE4M2NiOWVmNDk0N2I3MzA4MzMzZTg2M2U1YzYiLCJwIjoiaiJ9

Manual testing steps

Not testable, this pr only introduces

Screenshots/Recordings

N/a. Not testable because it is not wired up.

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

Medium Risk
Adds new hardware-wallet error modal orchestration and new Redux state/actions that can affect approval/popup lifecycle. Also broadens RPC error deserialization/mapping logic, which could change how hardware-wallet failures are surfaced and retried.

Overview
Adds a new HardwareWalletErrorProvider/useHardwareWalletError that watches HardwareWalletContext for error states and dispatches a HARDWARE_WALLET_ERROR modal with retry/cancel behavior, including special handling to suppress auto-modals for user-cancel/user-reject errors unless explicitly shown.

Introduces appState.pendingHardwareSigning with SET_PENDING_HARDWARE_SIGNING + setPendingHardwareWalletSigning, plus selectors (getPendingHardwareSigning, getIsHardwareWalletErrorModalVisible) to help coordinate popup auto-close behavior while an error modal is open.

Refactors rpcErrorUtils to robustly detect and reconstruct hardware-wallet errors across the RPC boundary (including serialized data.cause shapes, string/numeric ErrorCodes, KeyringControllerError, and Ledger status-code mapping), and tightens connection cleanup in useHardwareWalletConnection to avoid nulling a newly replaced adapter. Updates/extends unit tests and the metrics e2e state snapshot accordingly.

Written by Cursor Bugbot for commit 4604558. 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 metamaskbot added the team-accounts-framework Accounts Framework team label Jan 20, 2026
cursor[bot]

This comment was marked as outdated.

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Jan 20, 2026

Builds ready [b19aab3]
UI Startup Metrics (1308 ± 105 ms)
PlatformBuildTypePageMetricTest Title (ms)Persona (ms)Mean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--13081037160810513741492
load--1092878137710511471273
domContentLoaded--1085872136810511421267
domInteractive--2816144212482
firstPaint--175631130146193301
backgroundConnect--22220025911230241
firstReactRender--15103241722
getState--3718129144261
initialActions--106113
loadScripts--87267111721059281058
setupStore--1373551424
numNetworkReqs--171165151162
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--18911464236818920192278
load--98788715491129911253
domContentLoaded--97588315411139701246
domInteractive--3318147233396
firstPaint--173661186126217343
backgroundConnect--276203691132238626
firstReactRender--23155682444
getState--16613127927182228
initialActions--107112
loadScripts--76667112901097661038
setupStore--17104171937
numNetworkReqs--1003923142128204
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--802659104578862949
load--64657987067652791
domContentLoaded--64157586066648785
domInteractive--2516118202179
firstPaint--1115961071145223
backgroundConnect--316130284594
firstReactRender--15103541622
getState--3315137174360
initialActions--105112
loadScripts--63757285765646777
setupStore--1153041219
numNetworkReqs--171177171166
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--1316979201626313921890
load--682591125992684881
domContentLoaded--672585125092670876
domInteractive--34171212633115
firstPaint--1336143971162251
backgroundConnect--86669418419606
firstReactRender--22183532430
getState--14612520914155173
initialActions--102111
loadScripts--668583124091668867
setupStore--1695371637
numNetworkReqs--1093933050136221
19--------
FirefoxBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--14841145201619216271834
load--1186957176614612671447
domContentLoaded--1185957176614612661447
domInteractive--832524348113171
firstPaint--------
backgroundConnect--66212995590177
firstReactRender--1511117111426
getState--1367391232
initialActions--103122
loadScripts--1140941173712012121350
setupStore--154210231249
numNetworkReqs--19979181473
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--25411815547773324934839
load--1249972305139911892548
domContentLoaded--1249971305139911882548
domInteractive--1033457475110249
firstPaint--------
backgroundConnect--126291223202105438
firstReactRender--2715281282452
getState--24666846198336716
initialActions--218123
loadScripts--1184955286532611491683
setupStore--15210807200149681
numNetworkReqs--5229118217691
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--15721251224218517151870
load--13141084174013213981543
domContentLoaded--13141084174013213981543
domInteractive--822723346116154
firstPaint--------
backgroundConnect--65212285086162
firstReactRender--15112321620
getState--207235321481
initialActions--103022
loadScripts--12731068160811313541489
setupStore--164145201449
numNetworkReqs--19991181373
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--28781978480282934104634
load--15431100318956214732983
domContentLoaded--15421094318956214732981
domInteractive--11831189220798258
firstPaint--------
backgroundConnect--2112213063131731122
firstReactRender--2915233262963
getState--378751834330576875
initialActions--218123
loadScripts--14351083316945114342949
setupStore--12211752168115637
numNetworkReqs--4930103197083
19--------
📊 Page Load Benchmark Results

Current Commit: b19aab3 | Date: 1/20/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±37ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 717ms (±34ms) 🟢 | historical mean value: 732ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 75ms (±10ms) 🟢 | historical mean value: 80ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 37ms 1.00s 1.30s 1.05s 1.30s
domContentLoaded 717ms 34ms 697ms 981ms 731ms 981ms
firstPaint 75ms 10ms 60ms 156ms 84ms 156ms
firstContentfulPaint 75ms 10ms 60ms 156ms 84ms 156ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

cursor[bot]

This comment was marked as outdated.

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Jan 20, 2026

Builds ready [085dc27]
UI Startup Metrics (1293 ± 100 ms)
PlatformBuildTypePageMetricTest Title (ms)Persona (ms)Mean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--12931028155410013691444
load--108286613449911471228
domContentLoaded--107686113339811421222
domInteractive--261695182375
firstPaint--165651062144191316
backgroundConnect--21919826312223244
firstReactRender--16103751827
getState--35186993856
initialActions--1010114
loadScripts--8656611129999271016
setupStore--1273641324
numNetworkReqs--171171151162
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--18941493249819420042339
load--1032909159912210701298
domContentLoaded--1019897158912310541279
domInteractive--35181302435100
firstPaint--1796850987219377
backgroundConnect--276207720125244618
firstReactRender--23165062438
getState--17713877165185240
initialActions--103111
loadScripts--80468913631208281064
setupStore--18115981839
numNetworkReqs--59371932561122
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--803647115796876998
load--65156990483712800
domContentLoaded--64556489682701794
domInteractive--2615102222095
firstPaint--1105727552151209
backgroundConnect--305128303994
firstReactRender--16113651729
getState--3013112163662
initialActions--104112
loadScripts--64256289381699791
setupStore--1163151225
numNetworkReqs--181178181170
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--1315963229128214311892
load--659575117497669859
domContentLoaded--649569116597655853
domInteractive--31161312529104
firstPaint--1416140675181316
backgroundConnect--75761416018550
firstReactRender--22163732328
getState--16212824420169209
initialActions--105111
loadScripts--646566115796653845
setupStore--1665191640
numNetworkReqs--943730551133222
19--------
FirefoxBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--13811076227419714771803
load--1104904161213311721355
domContentLoaded--1104899161213311721355
domInteractive--71312014092146
firstPaint--------
backgroundConnect--63198469066169
firstReactRender--13102121318
getState--136153171136
initialActions--103122
loadScripts--1069890158611311351254
setupStore--124122141134
numNetworkReqs--19977181375
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--24801879533669124404067
load--12651027277642311672584
domContentLoaded--12641026277642311662584
domInteractive--1043442575103341
firstPaint--------
backgroundConnect--120231102170115284
firstReactRender--22169192431
getState--28560899237493809
initialActions--208123
loadScripts--1214983254137511282468
setupStore--1438772192127666
numNetworkReqs--513098207687
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--15751189245823317042002
load--13201063201617814101631
domContentLoaded--13191063201517814091631
domInteractive--792827145112142
firstPaint--------
backgroundConnect--59193364969161
firstReactRender--16115251724
getState--178148201558
initialActions--2040422
loadScripts--12841051193116513591615
setupStore--166201241334
numNetworkReqs--18977161365
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--28732017686390637764612
load--16421104541270116143002
domContentLoaded--16421099541170116143001
domInteractive--10730105112498254
firstPaint--------
backgroundConnect--2222312653281641169
firstReactRender--241695112532
getState--31083914253507833
initialActions--217123
loadScripts--15081089538560215362798
setupStore--106877215399498
numNetworkReqs--5126157227090
19--------
📊 Page Load Benchmark Results

Current Commit: 085dc27 | Date: 1/20/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±62ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 728ms (±60ms) 🟢 | historical mean value: 734ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 76ms (±11ms) 🟢 | historical mean value: 80ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 62ms 1.01s 1.30s 1.25s 1.30s
domContentLoaded 728ms 60ms 698ms 986ms 924ms 986ms
firstPaint 76ms 11ms 60ms 156ms 88ms 156ms
firstContentfulPaint 76ms 11ms 60ms 156ms 88ms 156ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Jan 22, 2026

Builds ready [4548db5]
UI Startup Metrics (1298 ± 113 ms)
PlatformBuildTypePageMetricTest Title (ms)Persona (ms)Mean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--12981054171011313721461
load--1081878142910311501209
domContentLoaded--1075873142010111421202
domInteractive--251593172380
firstPaint--1436535867193284
backgroundConnect--22020325811226247
firstReactRender--16103951825
getState--421993165070
initialActions--108114
loadScripts--8626631186101933995
setupStore--1373241522
numNetworkReqs--171175161163
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--317215097842141945255927
load--1169947166015712811429
domContentLoaded--1149934163115312581390
domInteractive--40174084536112
firstPaint--209751600199237494
backgroundConnect--822212344685911362664
firstReactRender--23164462734
getState--36713829704733471207
initialActions--103111
loadScripts--919722139014510081158
setupStore--22684152660
numNetworkReqs--90452243499175
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--767607101890827944
load--61954281672682756
domContentLoaded--61353881071679751
domInteractive--231493191975
firstPaint--1055525246146189
backgroundConnect--2951353435119
firstReactRender--15104551624
getState--2713123163148
initialActions--103112
loadScripts--61053680871674744
setupStore--1164461123
numNetworkReqs--181178181173
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--1292956211423513871928
load--693594121899689914
domContentLoaded--6825881213100680898
domInteractive--37182083334127
firstPaint--1386540666175272
backgroundConnect--42867311418171
firstReactRender--22183332427
getState--15112851139155183
initialActions--102112
loadScripts--679586120498677894
setupStore--20855112143
numNetworkReqs--1093528044139202
19--------
FirefoxBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--14691144234923016081874
load--1177978203516612721435
domContentLoaded--1176977203416512721435
domInteractive--903188593105180
firstPaint--------
backgroundConnect--66192675092172
firstReactRender--14104851423
getState--176527521226
initialActions--103122
loadScripts--1132965194514411841327
setupStore--164259321245
numNetworkReqs--18978171367
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--26991975791664929163491
load--13271047241524114321784
domContentLoaded--13261047241524114321783
domInteractive--197511361196243422
firstPaint--------
backgroundConnect--318361319291457919
firstReactRender--24167482437
getState--19561688131224569
initialActions--207123
loadScripts--12611016236021513261623
setupStore--13621812157149531
numNetworkReqs--79321582787129
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--15491265232318716521966
load--12951080169412213601570
domContentLoaded--12951080169312213601570
domInteractive--922923446130172
firstPaint--------
backgroundConnect--59222094382154
firstReactRender--15115551623
getState--188247291434
initialActions--103122
loadScripts--12581066167310513041459
setupStore--145130181232
numNetworkReqs--19984181473
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--27391929465443429783608
load--14611207271723715541987
domContentLoaded--14611207271723715541987
domInteractive--15843812134203469
firstPaint--------
backgroundConnect--4083313233426781085
firstReactRender--23166382430
getState--23165828189293655
initialActions--203122
loadScripts--14021181268321214671696
setupStore--10617598109125346
numNetworkReqs--76311652784135
19--------
📊 Page Load Benchmark Results

Current Commit: 4548db5 | Date: 1/22/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.06s (±110ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 744ms (±123ms) 🟢 | historical mean value: 722ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 94ms (±175ms) 🟢 | historical mean value: 79ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.06s 110ms 1.01s 1.91s 1.29s 1.91s
domContentLoaded 744ms 123ms 697ms 1.77s 962ms 1.77s
firstPaint 94ms 175ms 60ms 1.84s 88ms 1.84s
firstContentfulPaint 94ms 175ms 60ms 1.84s 88ms 1.84s
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Jan 29, 2026

Builds ready [1295fcd]
UI Startup Metrics (1339 ± 109 ms)
PlatformBuildTypePageMetricTest Title (ms)Persona (ms)Mean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--13391091165510914071531
load--1141922146211212061323
domContentLoaded--1134918145011211961317
domInteractive--281685182580
firstPaint--155691102115200293
backgroundConnect--23921630815247268
firstReactRender--18114252031
initialActions--1011114
loadScripts--91170212341109671092
setupStore--1362541620
numNetworkReqs--221586181571
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--262715508900146327016178
load--1160944184216212881423
domContentLoaded--1140936183115612501410
domInteractive--36181372734114
firstPaint--209761405173258381
backgroundConnect--67728551878735613074
firstReactRender--2616196182643
initialActions--103112
loadScripts--899708156114810031165
setupStore--1573361828
numNetworkReqs--965126443105178
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--824662103386880974
load--68859289869741800
domContentLoaded--68358889468735792
domInteractive--251584162272
firstPaint--1005921638127183
backgroundConnect--39181462747107
firstReactRender--15103251629
initialActions--105112
loadScripts--68058689267733785
setupStore--1154261226
numNetworkReqs--221577171572
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--1292875233224514731685
load--73061410451017531001
domContentLoaded--7196091036102742995
domInteractive--37181882834111
firstPaint--1576551086193315
backgroundConnect--16213062367155237
firstReactRender--23174042429
initialActions--103111
loadScripts--7166071028100740987
setupStore--1244651318
numNetworkReqs--1454735959166276
19--------
FirefoxBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--15161129276829016302197
load--1209947222121912951669
domContentLoaded--1208947222021912951669
domInteractive--75313314995149
firstPaint--------
backgroundConnect--702424948100170
firstReactRender--16976101543
initialActions--103123
loadScripts--1172930210820512171643
setupStore--15385141545
numNetworkReqs--241285191983
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--286320038413103729564365
load--13551048597653613651989
domContentLoaded--13541047597653613651989
domInteractive--14838901121152397
firstPaint--------
backgroundConnect--42613040274715231075
firstReactRender--20142932226
initialActions--207123
loadScripts--13041026592052413171824
setupStore--127780117696604
numNetworkReqs--81362404692200
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--16951308216019318392065
load--14451132186113515361685
domContentLoaded--14441132186113515361685
domInteractive--913019542131147
firstPaint--------
backgroundConnect--742522747101169
firstReactRender--14112321518
initialActions--103122
loadScripts--14011117171911314871587
setupStore--145167201143
numNetworkReqs--231287191881
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--32702244909284934194586
load--17771468644253118312234
domContentLoaded--17761467644253118302233
domInteractive--15158644108143389
firstPaint--------
backgroundConnect--40112115053094261190
firstReactRender--25193852834
initialActions--214133
loadScripts--17151423639051617242189
setupStore--214131476283296734
numNetworkReqs--78372594582173
19--------
📊 Page Load Benchmark Results

Current Commit: 1295fcd | Date: 1/29/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±42ms) 🟡 | historical mean value: 1.03s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 723ms (±60ms) 🟢 | historical mean value: 720ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 89ms (±125ms) 🟢 | historical mean value: 77ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 42ms 1.01s 1.36s 1.05s 1.36s
domContentLoaded 723ms 60ms 700ms 1.27s 743ms 1.27s
firstPaint 89ms 125ms 64ms 1.34s 84ms 1.34s
firstContentfulPaint 89ms 125ms 64ms 1.34s 84ms 1.34s
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Base automatically changed from feat/hardware-wallet-state-manager-8 to main January 30, 2026 01:11
@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Jan 30, 2026

Builds ready [c7571ef]
UI Startup Metrics (1264 ± 132 ms)
PlatformBuildTypePageMetricTest Title (ms)Persona (ms)Mean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--12641013171013213511490
load--1082872142012211661301
domContentLoaded--1074866141712211581293
domInteractive--241592162076
firstPaint--2005811772361901073
backgroundConnect--21719426713222250
firstReactRender--1693241825
initialActions--103112
loadScripts--87266912121239591094
setupStore--1372351722
numNetworkReqs--221589191579
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--19101558225715319982202
load--1071950154313110781491
domContentLoaded--1056942153112910641476
domInteractive--3519121213596
firstPaint--181771501157221413
backgroundConnect--32229142529333386
firstReactRender--22175152433
initialActions--104112
loadScripts--81971412731218241205
setupStore--1563761827
numNetworkReqs--1214926555143247
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--8376791103938861023
load--69560198773738813
domContentLoaded--69059798372734806
domInteractive--251694172374
firstPaint--1026227747127192
backgroundConnect--38181662543104
firstReactRender--1693861929
initialActions--103112
loadScripts--68759598071732798
setupStore--1265571227
numNetworkReqs--211586171570
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--1276879207224414511729
load--70861913781246961037
domContentLoaded--69961313701246831028
domInteractive--35172033030107
firstPaint--14564557104168446
backgroundConnect--15913135948157307
firstReactRender--23174542530
initialActions--102011
loadScripts--69661213621226811020
setupStore--1251931417
numNetworkReqs--1265127359155254
19--------
FirefoxBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--14381133217519115301867
load--1151965201913812081355
domContentLoaded--1150965201813812081355
domInteractive--813396397100142
firstPaint--------
backgroundConnect--60262894870155
firstReactRender--14104971338
initialActions--103122
loadScripts--1121951200112711771250
setupStore--156154231169
numNetworkReqs--231281181876
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--27641917887780827504085
load--13191047251332912522260
domContentLoaded--13191046251332912512260
domInteractive--143351459173124513
firstPaint--------
backgroundConnect--3631314984537330999
firstReactRender--21143042428
initialActions--203123
loadScripts--12621030249230312182178
setupStore--2029758224369690
numNetworkReqs--70372154688187
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--17261444243719318422182
load--14731235185312515691687
domContentLoaded--14721234185312515681686
domInteractive--913222542128150
firstPaint--------
backgroundConnect--70262334784167
firstReactRender--15113531523
initialActions--2055522
loadScripts--14321216182111014811661
setupStore--2052193314108
numNetworkReqs--231291191980
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--28352068410850731913875
load--15611266242529216792268
domContentLoaded--15611266242529116792268
domInteractive--10734566100103391
firstPaint--------
backgroundConnect--2691101257211283814
firstReactRender--21153342428
initialActions--207123
loadScripts--14941242240425216092181
setupStore--2029761235365716
numNetworkReqs--68351884192175
19--------
📊 Page Load Benchmark Results

Current Commit: c7571ef | Date: 1/30/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.06s (±116ms) 🟡 | historical mean value: 1.03s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 742ms (±142ms) 🟢 | historical mean value: 718ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 89ms (±123ms) 🟢 | historical mean value: 76ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.06s 116ms 1.03s 2.18s 1.08s 2.18s
domContentLoaded 742ms 142ms 709ms 2.13s 752ms 2.13s
firstPaint 89ms 123ms 60ms 1.32s 88ms 1.32s
firstContentfulPaint 89ms 123ms 60ms 1.32s 88ms 1.32s
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs
  • background: 58 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: 603 Bytes (0.01%)

@@ -0,0 +1,231 @@
import React from 'react';
import { renderHook, act } from '@testing-library/react-hooks';
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like that's what we use for other renderHook imports in the codebase (but maybe that's deprecated yes..)

IMO, let's keep react-hooks here, and we can unify all that later all-at-once

Comment on lines 43 to 60
mockShowModal.mockImplementation((payload) => ({
type: 'MODAL_OPEN',
payload,
}));

// Mock hideModal to return a proper action object
mockHideModal.mockImplementation(() => ({
type: 'MODAL_CLOSE',
}));

mockSetPendingHardwareSigning.mockImplementation((payload) => ({
type: 'SET_PENDING_HARDWARE_SIGNING',
payload,
}));

mockCloseCurrentNotificationWindow.mockImplementation(() => ({
type: 'CLOSE_NOTIFICATION_WINDOW',
}));
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: But we could re-use constant here too (if we have any)

@@ -1,123 +1,44 @@
{
"DNS": "object",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Update snapshot changed this.

@github-actions github-actions bot added size-XL and removed size-L labels Jan 30, 2026
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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

setDisplayedError(null);
}
};
}, [dispatch]);
Copy link

Choose a reason for hiding this comment

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

Cleanup effect missing pendingHardwareSigning state reset

Medium Severity

The cleanup effect on unmount doesn't call dispatch(setPendingHardwareWalletSigning(false)), unlike resetModalState which is used by handleCancel, handleRetry, and dismissErrorModal. If the component unmounts while the modal is open (e.g., during navigation), the Redux state pendingHardwareSigning remains true, potentially preventing notification popups from auto-closing as intended by the selector getIsHardwareWalletErrorModalVisible.

Fix in Cursor Fix in Web

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Jan 30, 2026

Builds ready [4604558]
UI Startup Metrics (1300 ± 119 ms)
PlatformBuildTypePageMetricTest Title (ms)Persona (ms)Mean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--13001045162011913741512
load--1108897138710811761328
domContentLoaded--1101886137810911691322
domInteractive--261587182280
firstPaint--197631114186195297
backgroundConnect--23321128513239261
firstReactRender--1793652030
initialActions--104113
loadScripts--88368711551089431101
setupStore--1363761528
numNetworkReqs--221585181578
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--19461542309421420372247
load--1099956195216510981535
domContentLoaded--1082948194016110821514
domInteractive--40192143735125
firstPaint--209691946234234440
backgroundConnect--33928653347346453
firstReactRender--251674102741
initialActions--104112
loadScripts--83670915341398271214
setupStore--1764982032
numNetworkReqs--1175326355140245
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--8366671247989011006
load--695591101581751865
domContentLoaded--689583100881744860
domInteractive--2615104202284
firstPaint--1066132850144194
backgroundConnect--3518111203999
firstReactRender--16103561730
initialActions--103112
loadScripts--687581100180741858
setupStore--1153251221
numNetworkReqs--221586171574
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--1261884199623614631651
load--70361313231246981018
domContentLoaded--69460913181246861004
domInteractive--34161482732107
firstPaint--149671010146155425
backgroundConnect--16213236949159312
firstReactRender--22163332428
initialActions--103111
loadScripts--6916071308122684996
setupStore--1244851418
numNetworkReqs--1315327559160254
19--------
FirefoxBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--14191109199018215181700
load--1148958176515412311415
domContentLoaded--1147957176515412291415
domInteractive--71332354398146
firstPaint--------
backgroundConnect--722528856114197
firstReactRender--1394351317
initialActions--102022
loadScripts--1109944173713311711332
setupStore--114609931
numNetworkReqs--231283191878
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--26941960490352927623990
load--13051013254330712582023
domContentLoaded--13051013254330712582023
domInteractive--132341309163115388
firstPaint--------
backgroundConnect--32112914522902731026
firstReactRender--21156252328
initialActions--203123
loadScripts--1245997243426612281747
setupStore--1698815224252682
numNetworkReqs--71382184494182
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--16981380226618618262054
load--14451182177512215131661
domContentLoaded--14441176177512215131661
domInteractive--953123243132144
firstPaint--------
backgroundConnect--762520954120183
firstReactRender--15115651523
initialActions--103122
loadScripts--13971164165110114691582
setupStore--2442384613151
numNetworkReqs--231286171876
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--3182226410493115931574556
load--181213318860106618172846
domContentLoaded--181213308860106618172845
domInteractive--14135934172109578
firstPaint--------
backgroundConnect--30112613832562781005
firstReactRender--24166162531
initialActions--216123
loadScripts--176213068769105917342815
setupStore--19410802234316736
numNetworkReqs--71342384984207
19--------
📊 Page Load Benchmark Results

Current Commit: 4604558 | Date: 1/30/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.02s (±40ms) 🟡 | historical mean value: 1.03s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 713ms (±37ms) 🟢 | historical mean value: 718ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 74ms (±11ms) 🟢 | historical mean value: 77ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.02s 40ms 1000ms 1.31s 1.05s 1.31s
domContentLoaded 713ms 37ms 693ms 987ms 734ms 987ms
firstPaint 74ms 11ms 56ms 168ms 84ms 168ms
firstContentfulPaint 74ms 11ms 56ms 168ms 84ms 168ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: -444 Bytes (-0.01%)
  • ui: 1.34 KiB (0.02%)
  • common: 1.66 KiB (0.02%)

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

Labels

size-XL team-accounts-framework Accounts Framework team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants