-
Notifications
You must be signed in to change notification settings - Fork 107
Description
Describe the bug
We're running into an issue where SanityLive invalidates ALL queries in our sites when publishing any document in the Sanity studio. Doesn't matter if the document being published is even used any query. Simple reproduction showcasing and explaining the issue:
https://cap.so/s/w8e7yqbz3vg1j9g
To Reproduce
- Install the Next.js Sanity starter via https://www.sanity.io/manage?template=nextjs-sanity-clean&ref=nextjs-cms&new-project= or npm create sanity@latest -- --template sanity-io/sanity-template-nextjs-clean
- Add a random document type
- Add the document type to the schemaTypes index.ts file
- Run a build with npm run build
- Make requests with httpie, curl or visit a couple of pages and see that you get a cache hit
- Open the Sanity studio and make a new document of the random document type
- Make a new httpie/curl/visit the pages and see that you get a cache miss
- Make a new request and see that you get a cache hit
Expected behavior
Sanity live invalidating only the data / cache / queries that are affected by a change.
Which versions of Sanity are you using?
Happens with any version combination I've tried, but these are the versions installed in the starter
frontend folder:
@sanity/cli (global) 3.90.0 (latest: 3.97.1)
@sanity/image-url 1.1.0 (up to date)
@sanity/uuid 3.0.2 (up to date)
sanity 3.97.1 (up to date)
studio folder:
@sanity/cli (global) 3.90.0 (latest: 3.97.1)
@sanity/assist 4.3.0 (latest: 4.4.1)
@sanity/eslint-config-studio 5.0.2 (up to date)
@sanity/icons 3.7.4 (up to date)
@sanity/vision 3.97.1 (up to date)
sanity 3.97.1 (up to date)
What operating system are you using?
MacOS
Which versions of Node.js / npm are you running?
10.9.2
v22.16.0