-
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 some polling/StrictMode issues, along with some general refactorings #8414
Conversation
88c134e
to
9d40bc1
Compare
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 to the granularity of your commits, @brainkim, these changes were actually pretty easy to review! I left a few comments in-line, but nothing merge-blocking.
Speaking of merging, feel free to rebase and squash commits together before merging if you like, but I think I'd prefer to keep these separate commits (with a merge commit), instead of squashing the whole PR.
9d40bc1
to
90b5aeb
Compare
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.
This looks great @brainkim - thanks very much!
(just a gentle reminder to update the CHANGELOG
👍)
Take the gun. Leave the canoli.
ec5f909
to
5d1db15
Compare
@brainkim I just released this in |
Checklist:
Notes
Continuation of #8346
Spent some time deleting Reobserver, as well as fixing some polling misbehavior.
Most of the test changes are related to fixing StrictMode stuff. The timings of moving ObservableQuery logic to useEffect made it so that we need little bits of delay to get the tests working. The behavior doesn’t seem to have changed in any meaningful way, we just skip some renders when we refetch or rerender too soon. There was one test which just didn’t make sense, was never failable in any meaningful sense, and used timer mocks in a way which messed with other tests so I deleted it. Forgive me.
This should probably make Apollo Client “strict mode” safe, though it is roughly impossible to tell for certain.
Fixes
stopPolling
doesn't work when using React StrictMode #7221TODO: Investigate if this fixes
Apollo Client 3 - optimistic response with pollInterval doesnt work. #6858