Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(graphcache): Prevent cache writes during query operations #2978

Merged
merged 2 commits into from
Mar 5, 2023

Conversation

kitten
Copy link
Member

@kitten kitten commented Feb 24, 2023

Resolves #2977

Summary

This adds the missing invariants to data.ts that prevent cache writes during read/query operations, since users are not allowed to modify the cache during read operations.

Set of changes

  • Add dev-only invariant to prevent writes inside cache reads
  • Exclude squashLayer operations from this restriction
  • Update tests accordingly

@kitten kitten requested a review from JoviDeCroock February 24, 2023 14:50
@github-actions github-actions bot temporarily deployed to staging-2978 February 24, 2023 14:51 Inactive
Copy link

@PrescottJRynewicz PrescottJRynewicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All makes sense to me - just one nit pick about comments

docs/graphcache/errors.md Show resolved Hide resolved
@kitten kitten merged commit 9eb12f2 into main Mar 5, 2023
@kitten kitten deleted the fix/add-write-invariants branch March 5, 2023 15:07
This was referenced Mar 5, 2023
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.

(graphcache): Writing to the cache fails during cache read operations
3 participants