-
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: abort stale connection on reobserve (#9532) #9791
fix: abort stale connection on reobserve (#9532) #9791
Conversation
54dae34
to
4881f03
Compare
@javier-garcia-meteologica Thank you for contribution, could you give us a little more detail of what you are submitting this PR? |
@jpvajda I've added a description to this PR, which I had previously forgotten. |
eadf0b6
to
182b3e7
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 for fixing (and testing) this @javier-garcia-meteologica!
this.concast.removeObserver(this.observer, true); | ||
this.concast.removeObserver(this.observer); |
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.
We've been testing this change in the v3.7 betas thanks to #9718, with no problems so far.
@javier-garcia-meteologica These changes have been soft-published in |
It makes sure that after a ObservableQuery is reboserved (e.g. variables are changed), it unsubscribes from stale connections (those using old variables) so they can be cancelled by the browser.
Problem example: Use
watchQuery
with an interactivesearchValue
as input. When the user types too fast and the query take longer than the debounce limit (300ms), apollo client makes new connections to the bakend with the newsearchValue
. However old connections, which are a burden to the backend, are not aborted.Fixes #9532
Checklist: