fix(settings): show "Passkey limit reached" alert (FXA-13680)#20532
Open
fix(settings): show "Passkey limit reached" alert (FXA-13680)#20532
Conversation
Because:
- When a user already at the max passkey limit attempted to register
another passkey from a stale Settings session (e.g., a tab on a
second device), the auth-server correctly returned a 400 with
errno 226 ("Maximum number of passkeys reached"), but the UI
ignored the errno and rendered the generic "System not available.
Try again later." alert, misleading users into thinking the
service was down.
This commit:
- Inspects error.errno in the PagePasskeyAdd server-error catch
branch. Recognized errnos now render their existing localized
AuthUiErrors message via getLocalizedErrorMessage (errno 226 ->
"Passkey limit reached"); unknown errors keep the previous
generic-fallback + Sentry capture path.
- Widens the Glean error reason to auth_error_<errno> for known
auth-server errors so dashboards can distinguish them from
true server_error.
- Adds unit tests covering errno 226 from both
beginPasskeyRegistration and completePasskeyRegistration; the
existing unknown-error tests continue to pass.
Closes FXA-13680
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
PagePasskeyAddignorederror.errnoand rendered the generic "System not available. Try again later." alert — misleading users into thinking the service was down.This pull request
error.errnoin thePagePasskeyAddserver-error catch branch. Recognized errnos now render their existing localizedAuthUiErrorsmessage viagetLocalizedErrorMessage(errno 226 → "Passkey limit reached"); unknown errors keep the previous generic-fallback + Sentry capture path.auth_error_<errno>for known auth-server errors so dashboards can distinguish them from trueserver_error.beginPasskeyRegistrationandcompletePasskeyRegistration; existing unknown-error tests continue to pass.auth-error-226 = Passkey limit reachedand thePASSKEY_LIMIT_REACHEDAuthUiErrorsentry already existed.Issue that this pull request solves
Closes: FXA-13680
Checklist
How to review (Optional)
packages/fxa-settings/src/components/Settings/PagePasskeyAdd/index.tsx(server-error branch).index.test.tsx.errnocheck that delegates to the existinggetLocalizedErrorMessagehelper used elsewhere in fxa-settings; all unknown errors retain the original behavior.How to manually verify
PASSKEYS__MAX_PASSKEYS_PER_USER=1in auth-server config (or hit the real prod limit of 10).🤖 Generated with Claude Code