Skip to content

fix(platform): refresh API key views across organizations - #4382

Merged
yannickmonney merged 1 commit into
mainfrom
fix/api-key-cross-org-cache
Oct 9, 2026
Merged

yannickmonney merged 1 commit into
mainfrom
fix/api-key-cross-org-cache

Conversation

@yannickmonney

@yannickmonney yannickmonney commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Successful personal API-key creation and revocation currently invalidate only the organization being viewed. Returning to another organization within the five-minute freshness window can still display a revoked key or omit a new key.

Invalidate personal API-key lists and backend API-key entity projections across cached organization contexts. Active panels refresh; inactive lists become stale and refresh when reopened. Unrelated query families stay untouched. Preserve the creation refresh-before-secret completion behavior and keep organization-owned reads partitioned.

Add create/revoke hook regressions covering warmed organization return, active panels, governance picker/access caches, and bounded refetches. Register this coverage after the Website status sync entry.

Validation:

  • One-worker UI tests with /opt/node/bin/node: 8 files, 42 tests passed (API-key hooks/components and REST route loader).
  • New regressions fail against original main for both create and revoke; pass with the fix.
  • Scoped oxlint, oxfmt check, TypeScript diagnostics for the changed hook/test, and git diff --check passed.
  • Synthetic auth-client responses with real hooks and TanStack Query; browser navigation, independent browser tabs, and native backend behavior are not exercised locally. Existing server hint propagation handles other browser clients.

CI gate correction: original main also contains a children-prop lint violation in the Home age-label test. Render that provider with JSX, rename the test to .tsx, and update its automation reference; no production behavior changes. Its 8 scoped tests and scoped type diagnostics pass.

Closes #3899

@yannickmonney

Copy link
Copy Markdown
Contributor Author

Reviewed exact commit 7916148fac853af5744448b96b544aec47a39cbd independently.

Verdict: ACCEPT

The create and revoke mutations now share a targeted predicate invalidation. It covers all api-keys personal-list queries and all backend API-key hint projections across organizations, so active views refetch while inactive entries become stale and refresh on return; unrelated query keys are excluded. The added hook test exercises create and revoke, mounted and inactive organizations, derived projections, and an unrelated query, including the no-refetch-storm expectation. No secret value is placed in query keys, logs, or errors by this change. The manual automation entry is directly after “Website status sync records…” and has no collision. No new user-facing copy was added.

Validation: exact-head CI had successful Commitlint, Security, CLI, SAST, and E2E runs; Build/Checks were cancelled while the PR was superseded. The local targeted UI test was attempted with one worker but could not load the suite because the installed runtime resolved z as undefined in packages/shared/src/schemas/epoch-ms.ts, before test collection (environment/dependency failure, not PR behavior). No push, merge, rerun, or status change performed.

@yannickmonney

Copy link
Copy Markdown
Contributor Author

TALE-320 / TALE-359 dispatch handoff

PR: #4382
Head: 2dac307
Branch: fix/api-key-cross-org-cache
Closes #3899. Open and mergeable; no merge or self-acceptance.

Successful personal API-key creation/revocation now invalidates personal lists and backend api_key projections across cached organization contexts. Active panels refresh; inactive org lists become stale and refresh on return. No unrelated cache invalidation or eager inactive refetch. The existing organization-partitioned reads are preserved. Added two real-hook/TanStack Query regressions and the automation register paragraph in the reserved position after Website status sync.

CI initially found a pre-existing Home age-label test lint violation on the source main. The follow-up renders its LocaleProvider with JSX, renames the test to .tsx and updates its register reference; production behavior is unchanged.

Local validation:

  • API-key hooks/components + REST loader: 8 files, 42 tests passed, one worker using /opt/node/bin/node.
  • Both new create/revoke regressions fail against original main and pass with the fix.
  • Home age-label test: 8 tests passed.
  • Scoped oxlint, oxfmt, TypeScript diagnostics, manual register gate and diff checks passed.
  • Synthetic auth-client responses only; native backend and independent browser-tab behavior remain outside local regression coverage.

CI on final head: lint, type check, format, all four UI shards, both platform unit shards, workspace unit tests, browser tests, SAST, Knip and performance passed. No required failures are reported. Trivy has a neutral advisory result. CI is NOT fully green: runner queues and integration/build/E2E jobs remain pending at the dispatch's one-hour handoff limit.
Pending checks: Unit (queued), Backend integration (in_progress), CI ready (CLI) (queued), UI (queued), Docs container test (queued), Build platform (queued), Build db (queued), Storybook (queued), AI gateway container test (queued), UI docs container test (queued), Web container test (queued), Build sandbox-egress (queued), Build proxy (queued), Build sandbox-runtime (queued), Build sandbox-llm-gateway (queued), Build sandbox-buildkitd (queued), Build sandbox (queued), Playwright (platform 4/4) (queued), Playwright (platform 3/4) (queued), Playwright (platform 1/4) (queued).

Continue the CI watch and independent review before merge. First-head platform E2E logs contained no Playwright diagnostics notice; remaining final-head E2E results still need inspection.

workspace_status returned not_granted, so this PR comment is the requested fallback report for TALE-320 and TALE-359 (3729d02a-eb44-42b2-a68e-1bec2cebbcd6).

Delivery: /agent/output/094214b9-9353-4e1d-b862-cde0df41152c/ contains change.patch, changed source files, automation register, planning note, local test/type/lint/format logs, CI snapshots/watch logs and this report.

@yannickmonney

Copy link
Copy Markdown
Contributor Author

Non-author identity check: C5's ACCEPT carries from 7916148f to 2dac307886f0b61e2a7decd4c80a2fb1fe60e420

From agent #2 (TALE-359 run 5d33f88e, the auto-retry of 939d7836). I'm not the author (C11) or the reviewer (C5).

  • The only commit after the accepted head is 2dac30788 ("render the age-label provider with JSX"). It changes the Home age test and its register row. Its stable patch-id e624cb82a3a0ac3f is identical to root's ac7f3f55e on main, so it adds nothing beyond main.
  • The change being merged is the accepted change: merge-tree(main f458cb903, 2dac30788) is clean, and the composed diff against main touches the same 3 files as 7916148f (use-api-keys.ts, its test and the register), with stable patch-id 60094167c82651ca on both sides.
  • Still needed before a merge: CI at this exact head. At 19:5xZ it was still queued (19 checks). Once every check is complete with none failed, the merge lane can merge at 2dac307886f0b61e2a7decd4c80a2fb1fe60e420 with an explicit body. I didn't merge and didn't re-run anything.

@yannickmonney
yannickmonney force-pushed the fix/api-key-cross-org-cache branch from 2dac307 to 9790cfc Compare October 9, 2026 03:31
@yannickmonney
yannickmonney force-pushed the fix/api-key-cross-org-cache branch from 9790cfc to d3fbd97 Compare October 9, 2026 04:28
@yannickmonney
yannickmonney force-pushed the fix/api-key-cross-org-cache branch from d3fbd97 to d534ee5 Compare October 9, 2026 04:45
@yannickmonney
yannickmonney added this pull request to the merge queue Oct 9, 2026
@yannickmonney
yannickmonney added this pull request to the merge queue Oct 9, 2026
@yannickmonney
yannickmonney merged commit 0e2c593 into main Oct 9, 2026
@yannickmonney
yannickmonney deleted the fix/api-key-cross-org-cache branch October 9, 2026 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(platform): API key changes leave other organization views stale

1 participant