fix(settings): show rate-limit message on passkey 429#20531
Open
fix(settings): show rate-limit message on passkey 429#20531
Conversation
… mgmt Because: - If rate limiting errors were encountered during passkey management, an unhelpful error message would be displayed. This PR: - Displays standard rate limiting error messages to user in the event that rate limit is exceed.
Because: * The passkey_create_submit_frontend_error Glean metric now emits a new "rate_limited" value for the "reason" extra-key, but the description in fxa-ui-metrics.yaml still listed only the prior values. Data reviewers and dashboards that key off this description should reflect the full set of values. This commit: * Adds "rate_limited" to the documented reason values for passkey_create_submit_frontend_error. 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
POST /passkey/registration/start), the UI surfaced a misleading red banner reading "System not available. Try again later." — implying a server outage rather than a client-side throttle. QA filed this as must-fix before prod release.This pull request
PagePasskeyAddcatch block by checkingerrno === 114or HTTPcode === 429, mirroring the existing pattern inMfaGuardfor OTP requests (packages/fxa-settings/src/components/Settings/MfaGuard/index.tsx:154-160).getLocalizedErrorMessage()so the user sees the localized "You've tried too many times. Please try again {retryAfter}." (or generic) string from the existingauth-error-114/auth-error-114-genericFTL keys.Sentry.captureExceptionfor throttle responses since they are expected behaviour rather than exceptions.rate_limitedGlean reason onpasskeyCreateSubmitFrontendErrorso the metric distinguishes throttling from real server errors. The existing reasons in this metric (not_allowed,timeout, etc.) are also free-form strings.retryAfterLocalizedon begin, 429 generic on begin, and 429 on complete.No backend changes. No new FTL strings. Same fix covers both
/passkey/registration/startand/passkey/registration/finishsince the catch block is shared.Issue that this pull request solves
Closes: FXA-13666
Checklist
Put an
xin the boxes that applyHow to review (Optional)
packages/fxa-settings/src/components/Settings/PagePasskeyAdd/index.tsx— the rate-limit branch in the catch block.packages/fxa-settings/src/components/Settings/PagePasskeyAdd/index.test.tsx— three new test cases.How to Test
passkeyRegisterStart : ip_uid : 1 : 10 minutes : 10 minutes : block, which makes testing eay.