fix(cubejs): self-heal stale findUser scope cache on defineUserScope 404#68
Merged
Merged
Conversation
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>
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.
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
findUserscope yet, sodefineUserScopethrew404: source not foundfor a resource the user plainly owns.Fix: on that specific 404 — and only when a concrete
dataSourceId/branchId/branchVersionIdwas 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