fix(rest): resolve the ENVIRONMENT's analytics service for dataset queries#1707
Merged
Conversation
…eries The /analytics/dataset/query route resolved its service through the host provider, which ignores environmentId and returns the HOST kernel's analytics — whose strategy bridges are bound to the host data engine. A tenant's dataset query therefore aggregated over the host's (empty) tables: totals of 0 and empty groups on populated objects, while CRUD (per-env protocol resolution) saw the real data. - Extract resolveProtocol's env resolution (hostname → X-Environment-Id → single-project default) into resolveRequestEnvironmentId, shared so per-environment service resolutions can never disagree about a request's kernel. - The analytics route now resolves the env kernel's own 'analytics' service first (its bridges bind the env engine) and only falls back to the host provider. rest: 100 tests green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Layer 3 of the staging dashboard chain (after #1701 typed fallback + #1703 AST aggregate): the dataset-query route used the host provider, which ignores environmentId — tenant queries aggregated over the HOST kernel's (empty) engine:
Total Spend: 0and empty groups on a populated table,COUNT(*) FROM sys_user = 0while logged in.resolveProtocol's env resolution (hostname →X-Environment-Id→ single-project default) into a sharedresolveRequestEnvironmentIdso per-env service resolutions can never disagree.Companion cloud change adds 'analytics' to objectos
defaultRequiresso env kernels actually install the service. rest: 100 tests green.🤖 Generated with Claude Code