GraphQl Caching issue
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 970
- Forks
- 486
- Avg merge
- 3d 33m
- Merged PRs (30d)
- 170
Description
Parent Issue
No response
Problem Statement
When CACHEGRAPHQLQUERYCACHESIZE has been set other than 0 e.g CACHE_GRAPHQLQUERYCACHE_SIZE=5000
so it is possible that when a graphql endpoint hits after a user has logged out, so content is received for unauthenticated users, and when a user logs in, then expected content doesn't return for an authenticated user.
However when setting DOTCACHEGRAPHQLQUERYCACHE_SIZE=0 fix this issue but it has own cost so every query bypass the cache and hits the database.
Steps to Reproduce
- User logs in
- Authenticated content is returned via graphql query as expected
- User logs out
- Authenticated content is returned via graphql query and this is not expected
Acceptance Criteria
The query should return results according to user authorization.
dotCMS Version
24.* - ALL
Proposed Objective
Customer Support
Proposed Priority
Priority 2 - Important
External Links... Slack Conversations, Support Tickets, Figma Designs, etc.
The possible solution would be to add the user ID to the hash to store the GraphQL results, so the cache will have permission results correctly.
https://dotcms.freshdesk.com/a/tickets/27968
Assumptions & Initiation Needs
No response
Quality Assurance Notes & Workarounds
No response
Sub-Tasks & Estimates
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the GraphQL query cache and its authorization context with CACHE_GRAPHQLQUERYCACHE_SIZE set to a nonzero value. Reproduce the login, logout, and login sequence, then verify that cached results follow the requesting user's authorization without requiring the cache to be disabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, java
- Domain
- api, authentication, authorization, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100