Skip to content

fix(settings): re-enable StrictMode and upgrade React to 19.2.8 - #21131

Draft
vpomerleau wants to merge 2 commits into
mainfrom
FXA-14313
Draft

fix(settings): re-enable StrictMode and upgrade React to 19.2.8#21131
vpomerleau wants to merge 2 commits into
mainfrom
FXA-14313

Conversation

@vpomerleau

Copy link
Copy Markdown
Contributor

Because

  • StrictMode was removed during the React 19 upgrade, leaving no dev-time guard against mount effects that are not idempotent.
  • Adding a passkey was silently broken under StrictMode — the page showed a spinner and never prompted.
  • React was pinned to 19.0.8 as a workaround for passkey and 2FA functional failures.

This pull request

  • Restarts the passkey ceremony per effect run and re-enables StrictMode at the app root.
  • Guards backup-code generation, TOTP replace and the passwordless code send against duplicate server mutations.
  • Builds the settings context once per mount.
  • Records Glean view events once per mount via a useGleanView hook.
  • Keeps the query string on the cookies_disabled redirect.
  • Upgrades react and react-dom to 19.2.8.

Issue that this pull request solves

Closes: FXA-14313

Checklist

Put an x in the boxes that apply

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.
  • I have added necessary documentation (if appropriate).
  • I have verified that my changes render correctly in RTL (if appropriate).
  • I have manually reviewed all AI generated code.

How to review (Optional)

  • Key files/areas to focus on:
  • Suggested review order:
  • Risky or complex parts:

Screenshots (Optional)

Please attach the screenshots of the changes made in case of change in user interface.

Other information (Optional)

Any other information that is important to this pull request.

Because:
- StrictMode was removed during the React 19 upgrade, leaving no dev-time
  guard against mount effects that are not idempotent.
- Several of those effects held their once-guard in React state, which a
  second call in the same commit reads before the update lands.
- The duplicate call then mints a second secret, code or ceremony that
  invalidates the one the user is looking at.

This commit:
- Scopes the passkey ceremony to each effect run and re-enables StrictMode.
- Guards the 2FA backup codes, TOTP replace and passwordless code send.
- Builds the settings context once so alert bar calls are not orphaned.
- Records Glean view events once, keeping pings under the upload throttle.
- Keeps the query string on the cookies_disabled redirect.

Closes #FXA-14313
Because:
- The 19.0.8 pin was a workaround for passkey and 2FA functional failures
  that no longer reproduce once the mount effects are idempotent.

This commit:
- Bumps react and react-dom from 19.0.8 to 19.2.8.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant