Skip to content

bug(platform): failed initial API-key list stays on its loading skeleton #3676

Closed

Description

@yannickmonney

The hook settles to an error, but the page reads only data and passes undefined to ApiKeysTable. useListPage treats that as an initial pending query, so the loading skeleton remains after the request has finished.

Reproduced against 44e0dcf254975286c0e9dea443b5cd1ca6b23347. Suggested severity: P2.

Reproduction

  1. From an already authorized application shell, open Settings > API > REST with no cached API-key list.
  2. Have the API-key list request fail, for example because the session expires after shell authorization but before the list request is handled.
  3. Wait for the request and query retries to finish.

Expected: Replace the initial loading state with a readable failure and a way to retry or recover authentication.

Actual: The hook settles to an error, but the page reads only data and passes undefined to ApiKeysTable. useListPage treats that as an initial pending query, so the loading skeleton remains after the request has finished.

Impact: The keys page looks perpetually busy instead of reporting that it cannot load. People cannot distinguish a failed request from a slow list or discover a recovery action on the page.

Evidence

The actual Better Auth list endpoint returned 401. The real query was status:error and fetchStatus:idle while the actual page retained aria-busy=true loading skeletons, no alert and no toast.

Executed from /tmp/tale-audit-settings-44e0dcf2:

/Users/yannick/.npm/_npx/22f2fe8d8bc13000/node_modules/.bin/bun x --no-install vitest run --config /Users/yannick/.codex/notes/tale-100-findings/access-settings-proof/api-keys-batch2.vitest.config.ts --maxWorkers=1 --reporter=verbose --silent=false

Observed result: 5 passed (5), exit 0, in 3.32 seconds. Frozen observation/control proof: access-settings-proof/api-keys-batch2.test.tsx, config and api-keys-batch2.log.

Controls:

  • With a healthy native list response, the same page renders the stored key name and removes the loading state.
  • Normal create succeeds and the real revoke refusal shows visible feedback, isolating this issue to list error handling.

Source

Scope and deduplication

  • The actual create/revoke dialogs, API REST page, key table, hooks and Tale authClient run against the actual Better Auth 1.7.5 API-key plugin and native memory adapter. A fetch dispatcher installed before client import admits only /api/auth/api-key/* and calls auth.handler in process. Final proof makes no socket/network request.
  • Each test creates fresh synthetic user/session/key rows in memory. Secrets and passwords are random and never printed. No existing user, key, credentials, provider, production data or authentication settings are read or changed. This does not test the production PostgreSQL adapter.
  • The route harness supplies organization params and the link shell. It does not mount parent route/session guards: the refusal scenario represents an already authorized shell whose key request is rejected later. The actual API-key client does not redirect on this refusal.
  • Query retries are disabled to reach the settled failure state promptly. The application retries ordinary query errors; once retries finish it reaches the same unhandled error state. Window-focus refetch can trigger another request, but it is not a visible error or retry control.
  • An initial development-only harness run installed its dispatcher too late, causing Better Auth to try its default localhost URL and receive ECONNREFUSED. That run is retained as api-keys-batch2-working.log and is not evidence for these findings. The frozen passing run installs a closed dispatcher before module evaluation.
  • Searched the 931 all-state title cache and current 89-entry accepted ledger for API key, list, loading, skeleton, error and failure. No matching API-key list failure root was present.
  • Closed Bug: Form validation parity — create-task title, API-key name, project-secret name, and team name lack client max-length/trim, so server rejections surface as generic toasts (dialog stuck) or persist unbounded #1991 is input-validation parity; Bug: REST API key "Last used" stays "Never used" after authenticated calls #2317 is last-used timestamp recording. Neither covers the settled list-error state. The broader generic DataTable keyboard debt is unrelated. Final parent review is recorded below.

Independent parent verification

Independently reran the actual-client/native-memory-endpoint proof: 5/5 observation and control tests passed, exit 0 (3.61 seconds). Log: access-settings-proof/parent-api-keys-batch2.log. Read the full closed #1991 report: its overlong-name/trim validation now passes the local controls; this valid-name/native-401 and settled-list-failure evidence is distinct. Live all-state GitHub searches for API key loading/failure and the accepted ledger found no matching root.

Activity

  1. added
    agent-ready
    on Oct 29, 2026
  2. added a commit that references this issue on Oct 30, 2026
    6064f18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readybugservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions