Skip to content

Conversation

@n3ps
Copy link
Contributor

@n3ps n3ps commented Oct 30, 2025

Description

Cleanup the useless fallbacks in spread

Open in GitHub Codespaces

Changelog

CHANGELOG entry: null

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

Removes unnecessary ?? {} fallbacks in object spread operations across controllers, tests, and UI code.

  • Controllers
    • app/scripts/controllers/onboarding.ts: Replace { ...(this.state ?? {}) } with { ...this.state } in registerOnboarding.
    • app/scripts/controllers/preferences-controller.ts: Initialize reducer accumulator with { ...lostIdentities } instead of { ...(lostIdentities ?? {}) }.
  • Tests
    • Update mock setup to spread mockRequests directly (remove ?? {}) in multiple files under test/integration, including transaction confirmations, NFTs, DeFi, notifications, and swaps.
  • UI
    • ui/components/app/modals/new-account-modal/new-account-modal.container.js: Spread state.appState.modal.modalState.props directly.
    • ui/components/multichain/app-header/app-header.test.js: Spread stateChanges directly during store setup.

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

@n3ps n3ps requested a review from a team as a code owner October 30, 2025 02:59
@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.

@n3ps n3ps added the team-core-extension-ux Core Extension UX team label Oct 30, 2025
@metamaskbot
Copy link
Collaborator

✨ Files requiring CODEOWNER review ✨

👨‍🔧 @MetaMask/core-extension-ux (1 files, +1 -1)
  • 📁 ui/
    • 📁 components/
      • 📁 multichain/
        • 📁 app-header/
          • 📄 app-header.test.js +1 -1

cursor[bot]

This comment was marked as outdated.

@metamaskbot
Copy link
Collaborator

📊 Page Load Benchmark Results

Current Commit: 0c2cd9d | Date: 10/30/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±38ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 719ms (±36ms) 🟢 | historical mean value: 727ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 76ms (±11ms) 🟢 | historical mean value: 77ms ⬇️ (historical data)
📈 Detailed Results
Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 38ms 1.01s 1.31s 1.07s 1.31s
domContentLoaded 719ms 36ms 698ms 983ms 744ms 983ms
firstPaint 76ms 11ms 60ms 164ms 84ms 164ms
firstContentfulPaint 76ms 11ms 60ms 164ms 84ms 164ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Results generated automatically by MetaMask CI

@metamaskbot
Copy link
Collaborator

Builds ready [0c2cd9d]
UI Startup Metrics (1255 ± 89 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1255110616568912971415
load107694013437911261238
domContentLoaded107093513367911201233
domInteractive19146181841
firstPaint64297126842810811152
backgroundConnect2282152617232244
firstReactRender27175273141
getState1983762233
initialActions71609719
loadScripts8487131118778971002
setupStore1062531018
numNetworkReqs86245624
BrowserifyPower User HomeuiStartup22291864332449523363324
load1183957174829715561748
domContentLoaded1175951174129715471741
domInteractive321768194468
firstPaint573219110134210001101
backgroundConnect25822235240289352
firstReactRender26223122831
getState18616223524211235
initialActions11349132349
loadScripts928732144526312311445
setupStore1182441224
numNetworkReqs373199691189539691
WebpackStandard HomeuiStartup8487271112798521063
load63958792179641874
domContentLoaded63158090978635851
domInteractive15115181437
firstPaint22356904219201820
backgroundConnect23115482542
firstReactRender27174873234
getState1262741419
initialActions3114247
loadScripts62857889875632839
setupStore1052231115
numNetworkReqs86306628
WebpackPower User HomeuiStartup17891388267644923702676
load785631117920911151179
domContentLoaded73961910821579261082
domInteractive18134472144
firstPaint3568211343596561134
backgroundConnect14210506185375506
firstReactRender27243732637
getState15311818516160185
initialActions613391133
loadScripts73461610681539151068
setupStore1063161131
numNetworkReqs412229761178554761
FirefoxBrowserifyStandard HomeuiStartup1452128217769115181609
load1242109415017512911376
domContentLoaded1242109415017512901375
domInteractive1163631042135190
firstPaint------
backgroundConnect392397144567
firstReactRender26216272647
getState74565713
initialActions3129336
loadScripts1217107714257112701347
setupStore146197191328
numNetworkReqs86315720
BrowserifyPower User HomeuiStartup28332300479166631714791
load14701219192518515361925
domContentLoaded14701218192518515351925
domInteractive17911239074223390
firstPaint------
backgroundConnect2572914943593681494
firstReactRender422984154684
getState15210529348176293
initialActions12152151352
loadScripts14041191178313814871783
setupStore35999255499
numNetworkReqs296178700134359700
WebpackStandard HomeuiStartup16041441234715316251959
load13801205178210714181573
domContentLoaded13791205178110714181573
domInteractive1103057773111208
firstPaint------
backgroundConnect4725141205292
firstReactRender28227982836
getState74223813
initialActions5118819312
loadScripts13501194175610413921546
setupStore1366291238
numNetworkReqs86306726
WebpackPower User HomeuiStartup27102230364639929543646
load15841244217126618302171
domContentLoaded15841243217126618292171
domInteractive1558137972182379
firstPaint------
backgroundConnect14927603161295603
firstReactRender432992154892
getState1267219030139190
initialActions2312325513232
loadScripts15391228203923917702039
setupStore2161002221100
numNetworkReqs260147507104348507
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 56 Bytes (0%)
  • ui: -4 Bytes (0%)
  • common: 10 Bytes (0%)

NidhiKJha
NidhiKJha previously approved these changes Oct 30, 2025
@metamaskbot
Copy link
Collaborator

📊 Page Load Benchmark Results

Current Commit: 7ec8907 | Date: 10/31/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±40ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 724ms (±38ms) 🟢 | historical mean value: 724ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 76ms (±9ms) 🟢 | historical mean value: 76ms ⬆️ (historical data)
📈 Detailed Results
Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 40ms 1.02s 1.33s 1.08s 1.33s
domContentLoaded 724ms 38ms 704ms 1.00s 758ms 1.00s
firstPaint 76ms 9ms 60ms 152ms 88ms 152ms
firstContentfulPaint 76ms 9ms 60ms 152ms 88ms 152ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Results generated automatically by MetaMask CI

@metamaskbot
Copy link
Collaborator

Builds ready [7ec8907]
UI Startup Metrics (1255 ± 88 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1255109115408813261402
load107693412808411431218
domContentLoaded107092812738311361209
domInteractive19136991741
firstPaint60696122142910701199
backgroundConnect2262152446229235
firstReactRender27194963039
getState2178792534
initialActions61284716
loadScripts850719104583916988
setupStore1051621114
numNetworkReqs96338632
BrowserifyPower User HomeuiStartup23301825442475332024424
load1199963209436416192094
domContentLoaded1191955208336316082083
domInteractive40162425444242
firstPaint825222174145910131741
backgroundConnect275226670105267670
firstReactRender26243022830
getState18716328329206283
initialActions1025916659
loadScripts951736172233313551722
setupStore1393351333
numNetworkReqs341180743210682743
WebpackStandard HomeuiStartup8687511127728821038
load65059893768657842
domContentLoaded64259092567650832
domInteractive16124571434
firstPaint22160857218204764
backgroundConnect24135182843
firstReactRender27174173335
getState1262641418
initialActions3015247
loadScripts63858891365648820
setupStore1052131215
numNetworkReqs96348833
WebpackPower User HomeuiStartup17001200266545523802665
load76159512742259291274
domContentLoaded71958510711748931071
domInteractive18124093040
firstPaint4706910743829301074
backgroundConnect14220503176277503
firstReactRender25213732537
getState14813219213148192
initialActions605714257
loadScripts71458210611718801061
setupStore12552121552
numNetworkReqs329191658167592658
FirefoxBrowserifyStandard HomeuiStartup1479129318639815291641
load1255112114336412981383
domContentLoaded1255112114336412981382
domInteractive1113423743118219
firstPaint------
backgroundConnect44271472248103
firstReactRender25215352538
getState84518820
initialActions52919410
loadScripts1228110314046312691358
setupStore147187191327
numNetworkReqs96347730
BrowserifyPower User HomeuiStartup30142384423853735004238
load15351281208318515772083
domContentLoaded15351280208318515772083
domInteractive17710341179233411
firstPaint------
backgroundConnect2824810002444811000
firstReactRender42335485254
getState14211620525158205
initialActions1225917959
loadScripts14461221177514415081775
setupStore4091774141177
numNetworkReqs266161570103305570
WebpackStandard HomeuiStartup15821430198411816131894
load1358121816889414031580
domContentLoaded1358121816889414031580
domInteractive1103043071113329
firstPaint------
backgroundConnect4523123174975
firstReactRender312278132971
getState9414015915
initialActions526610312
loadScripts1332120016629113801555
setupStore1277481226
numNetworkReqs96337731
WebpackPower User HomeuiStartup27802370331532331523315
load15971320189419718711894
domContentLoaded15971319189419718711894
domInteractive1548427256206272
firstPaint------
backgroundConnect16838542148282542
firstReactRender49311031751103
getState1327418424139184
initialActions611241012
loadScripts15431280185717716881857
setupStore32665205865
numNetworkReqs25715949398327493
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 2.67 KiB (0.06%)
  • ui: 236 Bytes (0%)
  • common: 4.99 KiB (0.06%)

@n3ps n3ps requested a review from NidhiKJha October 31, 2025 13:45
@n3ps n3ps enabled auto-merge October 31, 2025 14:51
@n3ps n3ps added this pull request to the merge queue Oct 31, 2025
Merged via the queue into main with commit e19cfa2 Oct 31, 2025
301 of 488 checks passed
@n3ps n3ps deleted the n3ps/cleanup-1029 branch October 31, 2025 16:51
@github-actions github-actions bot locked and limited conversation to collaborators Oct 31, 2025
@metamaskbot metamaskbot added the release-13.9.0 Issue or pull request that will be included in release 13.9.0 label Oct 31, 2025
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-S team-core-extension-ux Core Extension UX team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants