Repository navigation
fix(platform): show a failed passkey list read with a retry - #4300
Merged
Merged
Conversation
Account settings rendered a passkey list read that failed exactly like a successful empty one: no rows, no notice, and "Add a passkey" beside it, so a user could conclude no passkey was registered (#3845). The section now reads the list through `readStateOf`: a list that never answered shows `CatalogLoadError` with Try again, a failed refresh keeps the listed passkeys under a refresh notice, and only a list that answered empty says there are none yet. Try again stays mounted, busy and focusable through its retry; when the list comes back the focus moves to the Passkeys section instead of the page body. Adds the EN/DE/FR copy, the AUTH-B16 manual box with its automation row, and a component suite on the real query and retry policy. Closes #3845
The background re-failure case now waits for the re-keyed message, so it checks Try again after the refresh settled rather than while it runs, and the failed-refresh case checks that healing hands the focus to the Passkeys section.
A request blocked in devtools rejects before Better Auth's own retries, which only follow a non-OK answer, so the notice shows after react-query's three retries: a few seconds, not the 40 s a 5xx answer takes.
Contributor
Author
|
Independent review — ACCEPT at exact head
Unrun / observed limits: the focused Vitest command was attempted once at this exact head with one worker but test collection stopped before running tests because the standing checkout’s installed Zod runtime exposes |
This was referenced Oct 4, 2026
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.
What changed
When the passkey list read failed, Account → Passkeys looked exactly like a successful empty list: no rows, no notice, and Add a passkey right beside it (#3845). The cause was in
passkey-section.tsx. It only read{ data, isLoading }, and it drew rows only forpasskeys.length > 0.passkey-section.tsxnow reads the list throughreadStateOf(app/lib/backend/read-state.ts) and reusesCatalogLoadError. This is the pattern the knowledge-entry history uses (Bug: failed knowledge-entry reads look like an empty library or missing history #3777).aria-busy/aria-disabled, not natively disabled) while its retry runs. This also holds for the app's errored-read refetch when the window regains focus. When the list comes back, the alert's focus handoff moves focus to the Passkeys section, which getstabIndex={-1}as its target, never to the page body. If the read fails again, Try again keeps its node and its focus, and the failure is announced again.twoFactor.passkeys.empty,errors.listFailedanderrors.refreshFailedin EN/DE/FR. There's no ß, so no de-CH override is needed.AUTH-B16box (block the list request in devtools), plus itsreference/automation.mdrow.How I verified it
passkey-section.read-failure.test.tsxuses the real react-query query and its four-attempt retry policy, a mocked Better Auth client, and the 2FA status over the synthetic transport. It has 14 tests, all passing on this branch.passkey-section.tsxand catalogs and ran the suite. 12 of 14 failed on their assertions (Unable to find role="alert"×11, missing empty copy ×1). The 2 controls passed: listing a returned passkey, and claiming nothing while the first read runs.isErrorwith no busy state. That fails exactly the 3 focus tests: busy and focused through a pressed retry, keeping focus when the retry fails again, and keeping focus when a background refresh fails again.passkey-section.test.tsxpasses 4/4.account-form.{name,password}.test.tsxpass, though the password file timed out once at 5 s when run alongside the other files on 2 workers. It passed 7/7 alone, and it mocksPasskeySection.app/features/settings/accounton one worker: 9 files, 46/46 pass.bunx commitlint --from origin/main --to HEADpasses all three commits.lib/i18n/messages.test.ts(parity/usage) passes 24/24, and so dobun run lint:manualandcheck-guide.ts suites/auth.md. Type-awareoxlinton the changed files is clean,oxfmtreports no issues, and atsc --noEmitscoped to the changed files and their imports exits 0.tsc. CI runs those.Closes #3845