-
Notifications
You must be signed in to change notification settings - Fork 36
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
How can I overcome race conditions #342
Comments
This is something that can not really be tackled on our side - yes, we could rewrite the whole core of Apollo Client to add timestamps, but that's hardly a practical course of action (it would be a massive rewrite). The correct place to solve this is the React core - and they have signaled that they will add something for it, but only after the release of React 19. So we are waiting for upstream. Keep in mind that Next.js is based on a lot of React 19 features, and that React 19 is not released yet. That said, this package is over a year old at this point, and so far we haven't had anyone actually give us reports of these race conditions causing problems in real-world applications. I would say you are fine to use this package - we know of a few very big sites using it in production without problems.
These problems exist with any data fetching library. Either there is no support for streaming SSR at all, or they have all the same problems we have. |
Thanks @phryneas for the fast response <3 |
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Client usage and allow us to serve you better. |
Hi,
I was very scared from this message:
And I also found out in this issues page the following explanation: #28
At the end the mentioned issue, @phryneas suggests that maybe a timestamp mechanism could be used. (#28 (comment))
Is it still something that is planned to be done? It just feel very odd to me that a nextjs with apollo graphql wouldn't work, because they both a very very popular packages. and the described race is actually not that imaginary, it's certainly can happen in many many websites I know and also in the one i'm building.
Is there anything I can do to mitigate or solve as a workaround in my project? can I add control what is processed in the cache so I would implement the timestamp logic on my app? or any other workarounds? any plans? Is this issue occur with other graphql client packages?
The text was updated successfully, but these errors were encountered: