Skip to content

fix(25182): reloading page during SRP creation breaks flow #30178

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 15 commits into from
Feb 20, 2025

Conversation

vinnyhoward
Copy link
Contributor

@vinnyhoward vinnyhoward commented Feb 6, 2025

Description

Problem

Fixed an issue in the onboarding flow where refreshing the page during the Secret Recovery Phrase (SRP) confirmation step would result in a broken UI state. The solution redirects users to the unlock screen when SRP is needed but not available, retrieves the phrase after password verification, and returns them to their previous location in the flow. This ensures a smooth recovery from page refreshes during the onboarding process.

The Solution

  • Detects when user is on SRP-dependent routes
  • Redirects to unlock screen when SRP is needed
  • Retrieves SRP after password verification
  • Returns user to their previous step in the flow
  • This maintains the security of the SRP while improving the user experience during onboarding.

Open in GitHub Codespaces

Related issues

Fixes: #25182

Manual testing steps

  1. Start the Onboarding flow
  2. Create Wallet
  3. Click Secure your wallet
  4. Reveal your secret recovery phrase
  5. Go to Confirm Secret Recovery phrase
  6. Refresh the page
  7. See just 1 empty input and cannot perform any action + several errors in the ui console

Screenshots/Recordings

Before

before.mov

After

after.mov

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.

…low and the user refreshes the page, they lose their SRP
@vinnyhoward vinnyhoward requested a review from a team as a code owner February 6, 2025 22:45
Copy link
Contributor

github-actions bot commented Feb 6, 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

Builds ready [d697706]
Page Load Metrics (1858 ± 120 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint32822421615560269
domContentLoaded143523521834247118
load144923581858251120
domInteractive24109583215
backgroundConnect106623178
firstReactRender1598392813
getState45419199
initialActions01000
loadScripts100917821355208100
setupStore75716168
uiStartup162830082146346166
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 214 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@vinnyhoward vinnyhoward changed the title fix(25182): reloading page during onboarding breaks SRP flow fix(25182): reloading page during SRP creation breaks flow Feb 7, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [b03f532]
Page Load Metrics (1666 ± 59 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint20418331587332159
domContentLoaded14102001164612359
load14542004166612359
domInteractive2499412311
backgroundConnect106023178
firstReactRender1577382512
getState55417178
initialActions01000
loadScripts1030142211819546
setupStore67312147
uiStartup16492308192715273
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 214 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

darkwing
darkwing previously approved these changes Feb 7, 2025
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.

Awesome work!

@vinnyhoward vinnyhoward disabled auto-merge February 11, 2025 17:23
NidhiKJha
NidhiKJha previously approved these changes Feb 11, 2025
@vinnyhoward vinnyhoward dismissed stale reviews from NidhiKJha and darkwing via 3d3cc68 February 18, 2025 20:51
@metamaskbot
Copy link
Collaborator

Builds ready [3d3cc68]
Page Load Metrics (2086 ± 222 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint25730011880664319
domContentLoaded138529782054456219
load141429982086462222
domInteractive23172644220
backgroundConnect1294392713
firstReactRender1494372412
getState46619199
initialActions01000
loadScripts100319971500330159
setupStore75319168
uiStartup160932442343494237
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 214 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@EtherWizard33 EtherWizard33 self-requested a review February 20, 2025 09:12
Copy link
Contributor

@EtherWizard33 EtherWizard33 left a comment

Choose a reason for hiding this comment

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

LGTM!

@metamaskbot
Copy link
Collaborator

Builds ready [6b28089]

@metamaskbot
Copy link
Collaborator

Builds ready [d08d319]
Page Load Metrics (1736 ± 111 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint33723031637369177
domContentLoaded142222521710233112
load144523051736231111
domInteractive22202574421
backgroundConnect979312110
firstReactRender1475362311
getState56415178
initialActions01000
loadScripts10041784128020096
setupStore766222110
uiStartup170230082003314151
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 214 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@vinnyhoward vinnyhoward added this pull request to the merge queue Feb 20, 2025
Merged via the queue into main with commit f2d52fb Feb 20, 2025
79 checks passed
@vinnyhoward vinnyhoward deleted the fix-25182-reloading-page-loses-srp branch February 20, 2025 18:52
@github-actions github-actions bot locked and limited conversation to collaborators Feb 20, 2025
@metamaskbot metamaskbot added the release-12.14.0 Issue or pull request that will be included in release 12.14.0 label Feb 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.14.0 Issue or pull request that will be included in release 12.14.0 team-wallet-ux
Projects
Archived in project
5 participants