-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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: networkStatus
update Issue in useSuspenseQuery
with cache-and-network
policy
#11489
fix: networkStatus
update Issue in useSuspenseQuery
with cache-and-network
policy
#11489
Conversation
|
Name | Link |
---|---|
🔨 Latest commit | 8f59144 |
🦋 Changeset detectedLatest commit: 1d84f5d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Hey @gronxb 👋 Appreciate the PR! I'd like to dig into this a bit more, but you've made an interesting observation! Something I found curious was that if I remove the empty variables from i.e. const { data, networkStatus } = useSuspenseQuery(ALL_PEOPLE, {
fetchPolicy: "cache-and-network",
- variables: {},
}); Judging based on your changes, I'm willing to bet this is less about As for tests, we don't have many on our Appreciate you digging into this! |
Thanks for the advice, networkStatus is not updating when returning the same data, I've written test code for that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 💯 🔥 Thanks so much for diving into this issue and fixing it! Very much appreciated! I had a minor change to your changeset to give a bit more detailed description, but this looks great! Thanks again!
This PR resolves a bug where
useSuspenseQuery
with acache-and-network
fetch policy does not update itsnetworkStatus
when there's a concurrentuseReadQuery
with the same fetch policy.There is no test code in the cache folder, so I was unable to write a test, please advise if this is necessary.
I am attaching a reproduction of the error instead of the test code.
The expected result is that all networkStatus should be 7 (networkStatus.ready).
repro codesandbox
Bug Repro
Checklist: