Skip to content

fix(api-gateway): cache GraphQL schemas per security context using visibilityMaskHash#10570

Open
igorlukanin wants to merge 6 commits intomasterfrom
igor/core-384-investigate-graphql-schema-caching-causing-intermittent-400s
Open

fix(api-gateway): cache GraphQL schemas per security context using visibilityMaskHash#10570
igorlukanin wants to merge 6 commits intomasterfrom
igor/core-384-investigate-graphql-schema-caching-causing-intermittent-400s

Conversation

@igorlukanin
Copy link
Copy Markdown
Member

@igorlukanin igorlukanin commented Mar 27, 2026

Check List

  • Tests have been run in packages where changes have been made if available
  • Linter has been run for changed code
  • Tests for the changes have been added if not covered yet
  • Docs have been added / updated if required

Description of Changes Made (if issue reference is not provided)

GraphQL schema was cached globally, but different users have different field permissions (RBAC).

First user's schema got cached → all subsequent users saw that same schema with wrong fields.

Fix: Cache schemas per visibilityMaskHash - each unique permission set gets its own cached schema.

@igorlukanin igorlukanin requested a review from a team as a code owner March 27, 2026 14:10
@github-actions github-actions bot added the javascript Pull requests that update Javascript code label Mar 27, 2026
@igorlukanin igorlukanin force-pushed the igor/core-384-investigate-graphql-schema-caching-causing-intermittent-400s branch from f751af6 to 7d39e77 Compare March 27, 2026 14:13
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 27, 2026

Codecov Report

❌ Patch coverage is 30.43478% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.78%. Comparing base (23b66de) to head (7d39e77).
⚠️ Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
packages/cubejs-api-gateway/src/gateway.ts 0.00% 8 Missing ⚠️
...ackages/cubejs-server-core/src/core/CompilerApi.ts 46.66% 7 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10570      +/-   ##
==========================================
- Coverage   57.79%   57.78%   -0.02%     
==========================================
  Files         224      224              
  Lines       17547    17557      +10     
  Branches     3609     3613       +4     
==========================================
+ Hits        10142    10145       +3     
- Misses       6861     6867       +6     
- Partials      544      545       +1     
Flag Coverage Δ
cube-backend 57.78% <30.43%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@igorlukanin igorlukanin force-pushed the igor/core-384-investigate-graphql-schema-caching-causing-intermittent-400s branch from 6fb5c56 to 2cb33a3 Compare March 27, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Pull requests that update Javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant