Conversation
## Because - A passkey error stayed on the card after the user started a different sign-in method. - A card banner or tooltip error stayed on the card after the user clicked passkey, Google or Apple. - Two errors at once on the email-first and sign-in pages confuse the user. ## This pull request - Adds a `clearError` function to the `usePasskeySignIn` hook in `signin-flow.ts`. - Clears the passkey error on the Index page when the user submits the email form or clicks Google or Apple. - Clears the banner and tooltip errors on the Index page when the user clicks passkey, Google or Apple. - Applies the same two rules on the Signin page. - Adds 8 tests, 4 in each page test file. The Index `Subject` mock now turns the passkey feature flags on. ## Issue that this pull request solves Closes: https://mozilla-hub.atlassian.net/browse/FXA-14227
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The implementation consistently clears conflicting errors and provides focused coverage for each affected sign-in flow.
Pull request overview
Clears stale authentication errors when users switch sign-in methods.
Changes:
- Exposes passkey error clearing from
usePasskeySignIn. - Clears conflicting banner, tooltip, and passkey errors across Index and Signin.
- Adds interaction tests and passkey-enabled test setup.
File summaries
| File | Description |
|---|---|
packages/fxa-settings/src/lib/passkeys/signin-flow.ts |
Exposes clearError. |
packages/fxa-settings/src/pages/Index/index.tsx |
Clears stale errors between methods. |
packages/fxa-settings/src/pages/Index/index.test.tsx |
Tests Index error clearing. |
packages/fxa-settings/src/pages/Index/mocks.tsx |
Enables passkeys in tests. |
packages/fxa-settings/src/pages/Signin/index.tsx |
Clears Signin error collisions. |
packages/fxa-settings/src/pages/Signin/index.test.tsx |
Tests Signin error clearing. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Because
This pull request
clearErrorfunction to theusePasskeySignInhook insignin-flow.ts.Subjectmock now turns the passkey feature flags on.Issue that this pull request solves
Closes: https://mozilla-hub.atlassian.net/browse/FXA-14227
Checklist
Put an
xin the boxes that applyHow to review (Optional)
clearErrorsinIndex/index.tsxandSignin/index.tsx, andclearErrorinsignin-flow.ts.AppContextto set the passkey flags. The Google and Apple buttons use the existingonContinueWithGoogleandonContinueWithAppleprops, soThirdPartyAuthis unchanged.Screenshots (Optional)
Please attach the screenshots of the changes made in case of change in user interface.
None. The change removes an error that is already on the screen. It adds no new UI.
Other information (Optional)
The ticket screenshots could not be read by the pipeline. The two clearing rules are implemented as written in the ticket text.
Local results:
node scripts/test.js --watchAll=false src/pages/Index src/pages/Signin/index.test.tsx src/lib/passkeysinfxa-settings: 421 passed, 0 failed.npx nx lint fxa-settings: exit 0.npx tsc -p packages/fxa-settings/tsconfig.json --noEmit: no errors.The Playwright functional tests did not run locally. CI covers them.