-
Notifications
You must be signed in to change notification settings - Fork 48
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
Prismic client returns cached data if toolbar is disabled #198
Comments
Interesting one, thank you for contributing and suggesting a reproduction! I will investigate this week. |
OK, thanks for the reproduction! I managed to figure out what this was. We're fixing that in an upstream package: prismicio/prismic-client#310 In the meantime, rest assured, this only happens to Prismic developers because of some Prismic cookies misusage, not visitors of the website. |
@lihbr Thanks so much for taking a deep dive and fixing this issue! |
Hey @zrisher, after investigation we gain better knowledge about the issue and decided to label it as "wontfix" This is an edge case that affects only Prismic users under this scenario:
You can get out of this "corrupted" state. To do so, simply delete your Let us know if this does the trick for you, thank you again for your contribution! |
@lihbr I'm not sure you can really consider this an "edge" case, because the toolbar is enabled by default. Consider the following example, which I would wager occurs for over half of all developers installing this for the first time:
Surely there's a better way? Perhaps |
Hey @zrisher, thanks for insisting, you're right. Despite us not wanting the toolbar to be disabled because it kills previews for content editor, I can understand it becoming possibly annoying while developing. I'll check if the Nuxt module can do something about it! |
Thanks so much @lihbr! |
Should be fixed in https://github.com/nuxt-modules/prismic/blob/master/CHANGELOG.md#301-2023-06-21 Thanks again! |
Issue Description
The client returned from
usePrismic()
can provide stale data if the nuxt config containstoolbar: false
.Versions
Steps to reproduce
What is Expected?
The document will appear the same from both queries.
What is actually happening?
The query that uses the client from
usePrismic
shows old data, whereas the client pulled directly from@prismicio/client
returns the current state of the document.Notes
If you alter the
prismic
config object innuxt.config.js
it will invalidate the cached data and return the newest data for both queries (they will match once, then diverge after the next document update).If you remove
toolbar: false
from the prismic config, they will converge after each subsequent document update.The text was updated successfully, but these errors were encountered: