Skip to content

Conversation

@lwin-kyaw
Copy link
Contributor

@lwin-kyaw lwin-kyaw commented Nov 24, 2025

Description

Fixed social login authentication-state validation in rehydration flow.

Open in GitHub Codespaces

Changelog

CHANGELOG entry: fixed social login authentication validation in rehydrate.

Related issues

Fixes: #38172

Manual testing steps

  1. Click on create new wallet and login with existing social login account
  2. After completing social login, close the browser at the unlock page
  3. Open the browser and wallet again.
  4. You should be redirect back to the welcome 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

Refactors social login onboarding to async-validate auth before redirects, adjusts first-time flow checks, and simplifies Account Exist/Not Found to navigate without mutating flow state; updates tests accordingly.

  • Onboarding Welcome (ui/pages/onboarding-flow/welcome/welcome.js)
    • Replace getIsSocialLoginUserAuthenticated with getIsSocialLoginFlow and async auth check via getIsSeedlessOnboardingUserAuthenticated before redirecting.
    • Guard redirects with isMounted flag; handle social create vs import navigation accordingly.
    • Defer setting firstTimeFlowType for social flows until after OAuth result (set to socialCreate for new users, socialImport for existing).
  • Account pages
    • account-exist.tsx and account-not-found.tsx:
      • Remove setFirstTimeFlowType dispatches; rely on navigation only.
      • In useEffect, invert/clarify conditions to show page only for the matching FirstTimeFlowType (socialImport for exist, socialCreate for not-found); otherwise redirect to ONBOARDING_WELCOME_ROUTE.
      • Add "use different login method" handler to reset onboarding state and navigate to welcome.
  • Tests
    • Update tests to remove expectations around setFirstTimeFlowType and reflect new routing conditions and reset behavior in both account pages.

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

@lwin-kyaw lwin-kyaw requested a review from a team as a code owner November 24, 2025 10:52
@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-onboarding Onboarding team label Nov 24, 2025
@metamaskbot
Copy link
Collaborator

metamaskbot commented Nov 24, 2025

✨ Files requiring CODEOWNER review ✨

🔐 @MetaMask/web3auth (5 files, +52 -48)
  • 📁 ui/
    • 📁 pages/
      • 📁 onboarding-flow/
        • 📁 account-exist/
          • 📄 account-exist.test.tsx +2 -9
          • 📄 account-exist.tsx +4 -7
        • 📁 account-not-found/
          • 📄 account-not-found.test.tsx +2 -9
          • 📄 account-not-found.tsx +4 -8
        • 📁 welcome/
          • 📄 welcome.js +40 -15

@lwin-kyaw lwin-kyaw added release-blocker This bug is blocking the next release release-13.11.0 Issue or pull request that will be included in release 13.11.0 Sev1-high High severity; partial loss of service with severe impact upon users, with no workaround. labels Nov 24, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [cfc6d15]
UI Startup Metrics (1199 ± 109 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1199992158710912411444
load102185213049610551208
domContentLoaded101484712969410501200
domInteractive2715114242193
firstPaint52794134240010001184
backgroundConnect21019325010213237
firstReactRender2819149142945
getState311590113557
initialActions104112
loadScripts8106571076928421008
setupStore1062331119
numNetworkReqs1257821573
BrowserifyPower User HomeuiStartup18431522311427820302415
load98786619591859971491
domContentLoaded97385819341839661480
domInteractive39162344927177
firstPaint5319919784198971459
backgroundConnect21719425512225241
firstReactRender87461611896119
getState16512835038188229
initialActions1010114
loadScripts77266417251837671263
setupStore21789142852
numNetworkReqs916321133100185
WebpackStandard HomeuiStartup8346971213938641042
load648564103881693829
domContentLoaded64055785671689812
domInteractive28161302522104
firstPaint223821032159211626
backgroundConnect135346341025
firstReactRender2920218213138
getState271372133853
initialActions106112
loadScripts63755584869687803
setupStore1052941217
numNetworkReqs1257620572
WebpackPower User HomeuiStartup14581097237022515761907
load66356812671316631017
domContentLoaded65356112581316471009
domInteractive37172164227160
firstPaint289105796179376678
backgroundConnect1372751623
firstReactRender87501171397108
getState16814230333171264
initialActions103012
loadScripts65155812491296461001
setupStore20961132250
numNetworkReqs1426831355175290
FirefoxBrowserifyStandard HomeuiStartup12091068175010412361418
load101691512676910561174
domContentLoaded101591312677010521173
domInteractive52301442773103
firstPaint------
backgroundConnect3522161183772
firstReactRender22175462135
getState95243919
initialActions103112
loadScripts99489112486710361131
setupStore105578926
numNetworkReqs1156214650
BrowserifyPower User HomeuiStartup26611991355730828923321
load1157932174718812251538
domContentLoaded1156927174718812251538
domInteractive13033514116144428
firstPaint------
backgroundConnect16724770184198623
firstReactRender895317322100143
getState32782898299676867
initialActions3139527
loadScripts1122914172918011841484
setupStore974705138104503
numNetworkReqs90592184383196
WebpackStandard HomeuiStartup14391292200613115041746
load1219107714939512861402
domContentLoaded1219107514939512851402
domInteractive51271422868114
firstPaint------
backgroundConnect4116132204389
firstReactRender27207182935
getState136184211138
initialActions103012
loadScripts1197106114359012631381
setupStore135178181133
numNetworkReqs1256617664
WebpackPower User HomeuiStartup29412203399636631603579
load14551150199822116411886
domContentLoaded14551150199822116401886
domInteractive14528774160131593
firstPaint------
backgroundConnect206231241231256670
firstReactRender924218624103140
getState29886891279374856
initialActions4151737
loadScripts14171120197022016151855
setupStore1057772172105655
numNetworkReqs90592154582207
📊 Page Load Benchmark Results

Current Commit: cfc6d15 | Date: 11/24/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±40ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 719ms (±38ms) 🟢 | historical mean value: 726ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 76ms (±15ms) 🟢 | historical mean value: 78ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 40ms 1.01s 1.35s 1.05s 1.35s
domContentLoaded 719ms 38ms 696ms 1.02s 738ms 1.02s
firstPaint 76ms 15ms 60ms 212ms 84ms 212ms
firstContentfulPaint 76ms 15ms 60ms 212ms 84ms 212ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 53 Bytes (0%)
  • ui: 135 Bytes (0%)
  • common: 63 Bytes (0%)

@lwin-kyaw lwin-kyaw changed the title fix: social login authentication state before rehydrate fix: social login authentication state before rehydrate cp-13.11.0 Nov 24, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [97b3b51]
UI Startup Metrics (1190 ± 95 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1190100814229512451397
load100784812038410481171
domContentLoaded100284511978310441157
domInteractive27141152421100
firstPaint59390120240610161172
backgroundConnect2081902449213228
firstReactRender27195672846
getState3216104133559
initialActions104112
loadScripts79964799983838960
setupStore1062231118
numNetworkReqs1257720574
BrowserifyPower User HomeuiStartup18341600238416019152123
load98488316041499711367
domContentLoaded97286315951499511362
domInteractive38172164330162
firstPaint5289516333979401351
backgroundConnect21720025110222236
firstReactRender81451451989115
getState16512525527184214
initialActions103112
loadScripts76966213921497471157
setupStore1894782235
numNetworkReqs1106530648119202
WebpackStandard HomeuiStartup8397271104798641013
load65157886968659829
domContentLoaded64657385568653824
domInteractive31171312723108
firstPaint248105885172228643
backgroundConnect1153551324
firstReactRender28205473339
getState281483123547
initialActions104112
loadScripts64357184666651814
setupStore1172841220
numNetworkReqs1257720573
WebpackPower User HomeuiStartup13431157185215114521651
load617541988104610925
domContentLoaded608534978104597919
domInteractive33161613428128
firstPaint285106985222262877
backgroundConnect1474671534
firstReactRender79441051488103
getState15213042031155181
initialActions104112
loadScripts606532971102595912
setupStore18852122048
numNetworkReqs1456632557189281
FirefoxBrowserifyStandard HomeuiStartup12071056168810912531458
load101889813107910701187
domContentLoaded101789313107910651186
domInteractive57292583684115
firstPaint------
backgroundConnect3623157203780
firstReactRender21174842129
getState95536916
initialActions103112
loadScripts99788212937410451148
setupStore12519721933
numNetworkReqs1156616662
BrowserifyPower User HomeuiStartup24532035336726326142974
load1111930156014211301511
domContentLoaded1110926156014211291511
domInteractive12830573124115535
firstPaint------
backgroundConnect1023537961115252
firstReactRender85401752396127
getState298591362260420839
initialActions3027337
loadScripts1081910153013911011477
setupStore12291254178110545
numNetworkReqs925917833129150
WebpackStandard HomeuiStartup14141267205513414451746
load1192107214799312401392
domContentLoaded1191107114799312391392
domInteractive47261442858114
firstPaint------
backgroundConnect4317165234393
firstReactRender27217273036
getState1164671019
initialActions102122
loadScripts1169105514458812191356
setupStore145226241156
numNetworkReqs1256717665
WebpackPower User HomeuiStartup26742291323821027883078
load13901187204217314181774
domContentLoaded13901187204117314181773
domInteractive11332563118100456
firstPaint------
backgroundConnect1052448862122226
firstReactRender84461722090124
getState23962852208302720
initialActions4160837
loadScripts13531144199716713821742
setupStore12711679163117550
numNetworkReqs916120538100179
📊 Page Load Benchmark Results

Current Commit: 97b3b51 | Date: 11/24/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.07s (±51ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 744ms (±48ms) 🟢 | historical mean value: 727ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 80ms (±13ms) 🟢 | historical mean value: 80ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.07s 51ms 1.04s 1.46s 1.11s 1.46s
domContentLoaded 744ms 48ms 719ms 1.12s 777ms 1.12s
firstPaint 80ms 13ms 68ms 200ms 88ms 200ms
firstContentfulPaint 80ms 13ms 68ms 200ms 88ms 200ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 291 Bytes (0.01%)
  • ui: 114 Bytes (0%)
  • common: 20 Bytes (0%)

Copy link
Contributor

@himanshuchawla009 himanshuchawla009 left a comment

Choose a reason for hiding this comment

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

lgtm

@lwin-kyaw lwin-kyaw added needs-qa Label will automate into QA workspace and removed needs-qa Label will automate into QA workspace labels Nov 24, 2025
@lwin-kyaw lwin-kyaw enabled auto-merge November 24, 2025 14:34
@lwin-kyaw lwin-kyaw added this pull request to the merge queue Nov 24, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 24, 2025
@lwin-kyaw lwin-kyaw added this pull request to the merge queue Nov 24, 2025
Merged via the queue into main with commit 86412e0 Nov 24, 2025
186 of 187 checks passed
@lwin-kyaw lwin-kyaw deleted the fix/social-login-rehydrate branch November 24, 2025 16:06
@github-actions github-actions bot locked and limited conversation to collaborators Nov 24, 2025
@metamaskbot metamaskbot added the release-13.12.0 Issue or pull request that will be included in release 13.12.0 label Nov 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.11.0 Issue or pull request that will be included in release 13.11.0 release-13.12.0 Issue or pull request that will be included in release 13.12.0 release-blocker This bug is blocking the next release Sev1-high High severity; partial loss of service with severe impact upon users, with no workaround. team-onboarding Onboarding team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Wallet break after social login and close browser

5 participants