Skip to content

Conversation

@n3ps
Copy link
Contributor

@n3ps n3ps commented Oct 31, 2025

Description

No need for a nested if without else

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

Consolidates nested conditionals and adds minimal guard checks across background, controllers, services, streams, tests, UI, and selectors without altering behavior.

  • Background
    • Simplify phishing test bypass check in app/scripts/background.js by merging nested conditions.
  • Controllers
    • Streamline addPollingToken in app/scripts/controllers/app-state-controller.ts (combine checks and call updater directly).
  • Services
    • Tighten success URL match with optional chaining and simplify listener logic in app/scripts/services/subscription/subscription-service.ts.
  • Streams
    • Collapse legacy notification method remap conditional in app/scripts/streams/provider-stream.ts.
  • Tests
    • Flatten error-handling call generation logic in test/e2e/api-specs/MultichainAuthorizationConfirmationErrors.ts.
  • UI
    • Add onNetworkChange guard and merge conditions on multiselect submit in ui/components/.../asset-picker.tsx.
  • Selectors
    • Simplify connected-account selection logic in ui/selectors/selectors.js (ensure selected address not already connected).

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

@n3ps n3ps requested a review from a team as a code owner October 31, 2025 17:34
@n3ps n3ps added the team-core-extension-ux Core Extension UX team label Oct 31, 2025
@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

✨ Files requiring CODEOWNER review ✨

👨‍🔧 @MetaMask/core-extension-ux (1 files, +5 -6)
  • 📁 ui/
    • 📁 components/
      • 📁 multichain/
        • 📁 asset-picker-amount/
          • 📁 asset-picker/
            • 📄 asset-picker.tsx +5 -6

@MetaMask MetaMask deleted a comment from cursor bot Oct 31, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [fdc88d2]
UI Startup Metrics (1230 ± 77 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1230107714797712891360
load105089212477511041190
domContentLoaded104288612397610951182
domInteractive2014105131849
firstPaint63986124741610571142
backgroundConnect22721635815228244
firstReactRender281794112945
getState2185282538
initialActions706410721
loadScripts823673101875878966
setupStore1162441218
numNetworkReqs96327631
BrowserifyPower User HomeuiStartup20961662351557327853515
load1111850201637814422016
domContentLoaded1101843198137314241981
domInteractive251466163966
firstPaint90712420294779652029
backgroundConnect282175946204275946
firstReactRender26223842838
getState17113722222197222
initialActions52153715
loadScripts875674160530311011605
setupStore1182551225
numNetworkReqs325160707205647707
WebpackStandard HomeuiStartup84770615801168721073
load6295591386119618884
domContentLoaded6205521335115612879
domInteractive15114971439
firstPaint231531343245188723
backgroundConnect2512114122942
firstReactRender2717163153235
getState1152941417
initialActions3115348
loadScripts6175501297112610877
setupStore1052031215
numNetworkReqs96348631
WebpackPower User HomeuiStartup17051254248239822722482
load76062412902079241290
domContentLoaded71661011261608851126
domInteractive18123882338
firstPaint4527011313709221131
backgroundConnect13819496166296496
firstReactRender24202922529
getState15310622425151224
initialActions605413354
loadScripts71160811161578731116
setupStore15656142456
numNetworkReqs341186693160561693
FirefoxBrowserifyStandard HomeuiStartup1444128018579615011617
load1234108615207812881361
domContentLoaded1233108615197812881361
domInteractive1173426946132212
firstPaint------
backgroundConnect4326140185176
firstReactRender26215052639
getState64132710
initialActions3138435
loadScripts1207107114977612541340
setupStore1174541115
numNetworkReqs96306727
BrowserifyPower User HomeuiStartup27562348418146229184181
load14371291195115815291951
domContentLoaded14361291195115815291951
domInteractive16610729468258294
firstPaint------
backgroundConnect20244906211253906
firstReactRender432989144789
getState1487230854180308
initialActions10240101740
loadScripts13781204163811214771638
setupStore32580245680
numNetworkReqs252153560109312560
WebpackStandard HomeuiStartup1600143819469716571847
load1379123216348614311567
domContentLoaded1378123216338614301567
domInteractive1043340847107215
firstPaint------
backgroundConnect4226108154978
firstReactRender322380143073
getState9414315816
initialActions51719317
loadScripts1353121516048514051535
setupStore1273441322
numNetworkReqs96367727
WebpackPower User HomeuiStartup28612341370148434943701
load16601323226030020122260
domContentLoaded16601323226030020122260
domInteractive15969474110218474
firstPaint------
backgroundConnect22533597201451597
firstReactRender43301041747104
getState1266619734156197
initialActions9154121254
loadScripts15841282199224618911992
setupStore27793213893
numNetworkReqs287153574139374574
📊 Page Load Benchmark Results

Current Commit: fdc88d2 | Date: 10/31/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

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

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 38ms 1.01s 1.33s 1.07s 1.33s
domContentLoaded 730ms 36ms 699ms 1.00s 752ms 1.00s
firstPaint 77ms 10ms 60ms 160ms 84ms 160ms
firstContentfulPaint 77ms 10ms 60ms 160ms 84ms 160ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 93 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: 0 Bytes (0%)

@n3ps n3ps changed the title chore: unnecessary if chore: unnecessary if's Oct 31, 2025
@n3ps n3ps enabled auto-merge October 31, 2025 19:45
@n3ps n3ps added this pull request to the merge queue Nov 3, 2025
Merged via the queue into main with commit cc732fb Nov 3, 2025
462 of 487 checks passed
@n3ps n3ps deleted the n3ps/useless-if branch November 3, 2025 17:29
@github-actions github-actions bot locked and limited conversation to collaborators Nov 3, 2025
@metamaskbot metamaskbot added the release-13.9.0 Issue or pull request that will be included in release 13.9.0 label Nov 3, 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-M team-core-extension-ux Core Extension UX team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants