Skip to content

fix(cubejs): self-heal stale findUser scope cache on defineUserScope 404#68

Merged
acmeguy merged 1 commit into
mainfrom
fix/checkauth-scope-cache-self-heal
Jul 13, 2026
Merged

fix(cubejs): self-heal stale findUser scope cache on defineUserScope 404#68
acmeguy merged 1 commit into
mainfrom
fix/checkauth-scope-cache-self-heal

Conversation

@acmeguy

@acmeguy acmeguy commented Jul 13, 2026

Copy link
Copy Markdown

A datasource/branch/version created moments before a request (e.g. the pre-create "test unsaved params" flow, or testing a just-created datasource) may not be in the caller's cached findUser scope yet, so defineUserScope threw 404: source not found for a resource the user plainly owns.

Fix: on that specific 404 — and only when a concrete dataSourceId/branchId/branchVersionId was requested — invalidate the user cache and retry the same scope check once with fresh data. A genuine access miss still 404s identically; no scope is widened.

Surfaced by cxs2 spec 081 (Blue Car demo, US7 connect-datasource) as defect D8; verified live against the local stack (pre-create test / create / test-saved all Connection is OK).

🤖 Generated with Claude Code

A datasource/branch/version created moments before a request (e.g. the
pre-create 'test unsaved params' flow, or testing a just-created
datasource) may not be in the caller's cached findUser scope yet, so
defineUserScope threw 404 'source not found' for a resource the user
plainly owns. On that specific 404 (only when a concrete
dataSourceId/branchId/branchVersionId was requested), invalidate the
user cache and retry the same scope check once with fresh data; a
genuine access miss still 404s identically.

Surfaced by cxs2 spec 081 (Blue Car demo, US7 connect-datasource) as
defect D8.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@acmeguy acmeguy merged commit 5c1d199 into main Jul 13, 2026
3 checks passed
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.

1 participant