fetchMore leaks watched queries
See original GitHub issueI’m using fetchMore
on an ObservableQuery
that I’m already subscribed to. I’m not starting any new watchQueries. However, the Apollo Chrome inspector shows that each time I use fetchMore
to fetch another page of results, a new “watched query” appears in the list. These remain even after I unsubscribe from my original subscription. Is this expected? Is there something else I need to do to clean up old watchQueries when using fetchMore
?
This is all happening in ember-apollo-client, so it’s entirely possible there’s a bug or behavior in that integration specific to fetchMore
because this is the first time I’m trying to use it. Digging through react-apollo though I couldn’t find anything specific to deal with this sort of thing. And there doesn’t appear to be any documentation describing the behavior I’m seeing.
Side note: I am the maintainer of ember-apollo-client, so I’m quite interested in understanding and fixing this issue.
Intended outcome:
Use fetchMore
to load the next page of results. Expected that the “watched queries” list does not grow because I’m not actually starting a new query or making a new subscription to an ObservableQuery
.
Actual outcome:
The Apollo Chrome inspector shows that each time I use fetchMore
to fetch another page of results, a new “watched query” appears in the list. These remain even after I unsubscribe from my original subscription (i.e. when I change routes, all of them stick around except one).
Is this expected? Is there something else I need to do to clean up old watchQueries when using fetchMore
?
How to reproduce the issue:
Watch the Apollo Chrome inspector’s “watched queries” list while you use fetchMore
in any app that does so.
Version
- apollo-client@1.9.3
Issue Analytics
- State:
- Created 6 years ago
- Reactions:6
- Comments:16 (7 by maintainers)
Top GitHub Comments
The issue is still the same. We went through the hassle of installing 2.0 and the problem continues. We have build some workaround now but it is not a real solution.
Is there any update on this? It’s a pretty yucky leak.