Skip to content

fix: prevent multiple account creations in the same flow. #31543

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 3, 2025

Conversation

montelaidev
Copy link
Contributor

@montelaidev montelaidev commented Apr 3, 2025

Description

This pr prevents the creation of multiple accounts when clicking the create button multiple times prior to the modal closing.

Open in GitHub Codespaces

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/MMMULTISRP-134?atlOrigin=eyJpIjoiOTAzNjNjNmJlNTc2NDllNjliZTE5MDYwN2M5NmUxYTYiLCJwIjoiaiJ9

Manual testing steps

  1. Go to account menu
  2. Click on solana and go to the modal
  3. Click on the modal multiple times and see that only one account has been created after the modal closes.

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.

Copy link
Contributor

github-actions bot commented Apr 3, 2025

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

metamaskbot commented Apr 3, 2025

✨ Files requiring CODEOWNER review ✨

🖥️ @MetaMask/wallet-ux

  • ui/components/multichain/create-snap-account/create-snap-account.test.tsx
  • ui/components/multichain/create-snap-account/create-snap-account.tsx

@metamaskbot
Copy link
Collaborator

Builds ready [2be8c0e]
UI Startup Metrics (1180 ± 62 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1180106913576212321295
load1023925117059957994
domContentLoaded1017921116659957990
domInteractive16133841625
firstPaint733791168397270984
backgroundConnect96586910
firstReactRender20154161935
getState11338868
initialActions001001
loadScripts80671595058851921
setupStore7418278
WebpackHomeuiStartup21241708264123922412615
load16471331205418417572014
domContentLoaded16401328202118017531988
domInteractive171359111452
firstPaint222671805221223338
backgroundConnect281387173077
firstReactRender190543631168595
getState1232602589
initialActions314134
loadScripts16321324199517617491960
setupStore31727763229
FirefoxBrowserifyHomeuiStartup13671172200715613971792
load12301055185015112641627
domContentLoaded12301055185015212631626
domInteractive9940183248797
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2417111112433
firstReactRender23195052530
getState7321278
initialActions001001
loadScripts12081037182915112411603
setupStore6311267
WebpackHomeuiStartup15781321211016416391960
load13621148191515214341713
domContentLoaded13621147191515214331712
domInteractive10141157249097
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect25177172634
firstReactRender35296463748
getState10460979
initialActions003111
loadScripts13391130189215114121681
setupStore8545679
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 351 Bytes (0.01%)
  • ui: 11.76 KiB (0.17%)
  • common: -157 Bytes (0%)

@montelaidev montelaidev marked this pull request as ready for review April 3, 2025 07:29
@montelaidev montelaidev requested a review from a team as a code owner April 3, 2025 07:29
@metamaskbot
Copy link
Collaborator

Builds ready [bf910f5]
UI Startup Metrics (1286 ± 73 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1286111814497313371430
load111999213107411771279
domContentLoaded11129701305741183970
domInteractive18145061831
firstPaint802871311435220287
backgroundConnect117355910
firstReactRender20154042030
getState13536769
initialActions001001
loadScripts888750107073922986
setupStore8518289
WebpackHomeuiStartup21461711287623222532596
load16601350208117417612006
domContentLoaded16521347204917017571989
domInteractive171262121454
firstPaint1977539169251376
backgroundConnect3115230263076
firstReactRender212543561128694
getState1232962989
initialActions314134
loadScripts16441344202216617541963
setupStore30730659209
FirefoxBrowserifyHomeuiStartup13941170189015114231783
load12541053174114312981622
domContentLoaded12541052174014312981621
domInteractive10237223298797
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2617135172543
firstReactRender22194842427
getState7425378
initialActions001001
loadScripts12291035171713912741594
setupStore6417267
WebpackHomeuiStartup15111326206716215461973
load13071143185115013501719
domContentLoaded13071142185115013501718
domInteractive9240183269097
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect23176362434
firstReactRender33285043541
getState7430579
initialActions002111
loadScripts12851121183114913321697
setupStore7421278
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 351 Bytes (0.01%)
  • ui: 12.38 KiB (0.18%)
  • common: 63 Bytes (0%)

@montelaidev montelaidev enabled auto-merge April 3, 2025 09:58
@montelaidev montelaidev added this pull request to the merge queue Apr 3, 2025
@darkwing
Copy link
Contributor

darkwing commented Apr 3, 2025

Better solution could just be to disable the button upon click via local state.

Copy link
Contributor

@darkwing darkwing left a comment

Choose a reason for hiding this comment

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

Actually, I'd prefer we disable the button; that's a known, good UX practice rather than making an element look actionable when it isn't

Merged via the queue into main with commit 64eb2fa Apr 3, 2025
164 checks passed
@montelaidev montelaidev deleted the fix/mmmultisrp-134 branch April 3, 2025 13:45
@github-actions github-actions bot locked and limited conversation to collaborators Apr 3, 2025
@metamaskbot metamaskbot added the release-12.17.0 Issue or pull request that will be included in release 12.17.0 label Apr 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.17.0 Issue or pull request that will be included in release 12.17.0 team-accounts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants