Repository navigation
fix(platform): show API-key creation failures - #4267
Conversation
yannickmonney
left a comment
There was a problem hiding this comment.
Independent review — ACCEPT (TALE-608)
PR: #4267
Exact reviewed head: fb315d46454da3cc1edd1aaf08aa0e1eaa688043, confirmed at admission and immediately before this record (2026-10-04 08:43Z).
Reviewer: Codex #12, agent 31b27429-fe64-4694-86de-4169cb2067f3, distinct from implementation agent Codex #7 and run 534763c0. This is independent source/targeted-jsdom acceptance, not authorization to merge, move a card or bypass remaining gates.
Findings and observed proof
Read TALE-213 and GitHub #3675 as the contract; reviewed all seven changed files against current origin/main a9a19afdcc68b7114af8bace6b8db74ba1696c2f.
- Creation preserves the native error status/code, reuses
runAdapted/BackendApiErrorandfailureDetail, and catches the mutation once in the dialog's awaited submit handler. A 401UNAUTHORIZEDgets the localized session-ended/sign-in guidance. The existing mutation wrapper is a plain TanStack re-export: no second hook toast is introduced. - Exact-head targeted jsdom run: 8 files / 40 tests passed, exit 0 (41.54s). Real dialogs, actual mutation hooks, shared error normalization and Toaster run with synthetic auth-client responses. EN/DE/FR and sparse de-CH fallback pass; each localized refusal has one failure title, keeps name and Never expiry, leaves Create enabled, and recovers on successful retry. Valid creation trims the name, honors Never, and clears the secret/name on Done/reopen. Blank/33-character local validation and revoke-refusal retention pass. Included axe checks pass.
- Two additional independent probes passed, exit 0 (11.73s). One rendered destructive icon/toast preserves the exact whitespace-bearing draft and finite 30-day expiry, then retries with the trimmed name and
expiresIn: 2592000. A 500 response shows the localized failure title without exposing its synthetic private server message/code, retaining the draft and retry ability. Nine copied original cases were deliberately filtered out in this probe-only run; all nine ran in the 40-test run above. - Negative regression on current main: injected only the PR's unchanged regression test into a detached checkout of
a9a19afdcc68b7114af8bace6b8db74ba1696c2f: 5 expected refusal failures / 4 passing controls, exit 1 (15.04s). The four locale refusals and the non-auth refusal fail because no failure toast appears; valid trim/Never/reveal-reset, invalid-name and revoke-refusal controls remain green. Restored the exact PR head afterward; tracked sources have no review edits. - TALE-214/list behavior is untouched:
apiKeysQuery, revoke logic, query keys, success invalidations, table and loader are unchanged. Existing list cold-failure retry, stale-empty handling, successful-create invalidation/refetch timing, failed-refetch secret handoff and REST loader controls pass.git diff --checkpasses.
Blockers and unrun proof
Code/targeted acceptance blockers: none found. Merge gate still open: at final passive readback, all five Candidate source / Resolve source checks (Build, Checks, Commitlint, E2E, SAST) were queued; this receipt does not claim green CI. No CI rerun, cancellation or wait occurred.
Not run under this light-only admission: the actual Better Auth/native memory endpoint and real expired-session/sign-in round trip, production PostgreSQL, browser layout/focus/visual gate, full suites, or fresh lint/type-check/SAST execution. The author's static-check claims are not presented as independently rerun evidence. No native slot was consumed. Initial Bun/shared-worktree run failed during imports (font filesystem denial and Zod evaluation), executing no tests; the successful run uses Node and a review-only Vite filesystem allow-list, with unchanged production configuration. Disk remained 159 GiB free, above the 20 GiB floor.
Evidence: delivery box /agent/output/4c87f026-25be-448c-a1e9-e92841bf4f72/: head-node-tests.log, reviewer-probes.log, main-regression.log, frozen test sources, review-only config, initial harness-failure log and final-head-checks.json. No push, merge or card move. Next owner: TALE-359's authorized review/merge lane for outstanding CI and any separately admitted native/browser proof.
Register round (TALE-673): merged
|
What changed
UNAUTHORIZEDexplains that the session ended and asks the person to sign in again. Other refusals usefailureDetail; server faults do not expose their payloads.Verification
d4c519fa382614cefaa4a244fad287aff49c5614, with all affected production files verified identical: 5 expected refusal failures / 4 passing controls.--testTimeout=120000passed all 51 tests in 16 seconds, without a source/config change.oxlint --type-aware --type-check: passed.oxfmt --check: passed.git diff --check: passed.This run was admitted for light jsdom work only. Browser/visual review, the actual native Better Auth endpoint, production PostgreSQL and the full workspace suite were not run locally. CI and an independent reviewer retain those gates; no self-acceptance, merge, CI rerun/cancel or card move.
Closes #3675