Skip to content

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

Open
vpomerleau wants to merge 3 commits into
mainfrom
FXA-14313
Open

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

Conversation

@vpomerleau

@vpomerleau vpomerleau commented Sep 2, 2026

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.

This comment was marked as outdated.

This comment was marked as outdated.

@vpomerleau
vpomerleau force-pushed the FXA-14313 branch 2 times, most recently from 0ed2103 to 3fa3adb Compare September 3, 2026 20:04
@vpomerleau
vpomerleau requested a balanced review from Copilot September 3, 2026 20:05

This comment was marked as outdated.

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 one-shot server mutations so a second effect setup cannot resend them.
- 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.
Because:
- supportsKeysOptionalLogin stays false until the browser answers fxa_status,
  so the view event fired again when the reply flipped it.
- The first event reported third-party links as hidden on a page that goes
  on to show them.

This commit:
- Holds the signin view event until the fxa_status reply settles.
@vpomerleau
vpomerleau marked this pull request as ready for review September 3, 2026 23:28
@vpomerleau
vpomerleau requested a review from a team as a code owner September 3, 2026 23:28

get codeInput() {
this.checkPath();
// The URL changes before the new view commits, so waitForURL and checkPath

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice!

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.

3 participants