Skip to content
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

ObservableQuery and QueryInfo stays forever on skip:true #7205

Merged

Conversation

kamilkisiela
Copy link
Contributor

@kamilkisiela kamilkisiela commented Oct 22, 2020

Issue #7206

Cleanup logic is done on unsubscribe but when skip: true the component never starts a subscription.

Leaking

I got the bottle over 3 years ago when Apollo was in very early stage, thank you once again :)

Copy link
Member

@benjamn benjamn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to keep tearDownQuery private, but otherwise I approve of this solution. Thanks @kamilkisiela!

@benjamn benjamn merged commit 4ee52b3 into apollographql:release-3.3 Oct 22, 2020
@dotansimha
Copy link
Contributor

@benjamn any chance we can get a release for v3.2 with this fix + the fixes from #7165 and #7170 ?

@kamilkisiela kamilkisiela deleted the kamil-tear-down-on-skip branch October 22, 2020 15:48
benjamn added a commit that referenced this pull request Oct 29, 2020
Follow-up to #7205, per my comment in #7254:
#7254 (comment)

Instead of tearing down this.currentObservable only when
this.getOptions().skip is true in QueryData#removeQuerySubscription, I
split the tear-down functionality into a separate private method
(QueryData#removeObservable), which is now called everywhere
removeQuerySubscription is called, except in resubscribeToQuery, where we
specifically want to preserve this.observableQuery.
benjamn added a commit that referenced this pull request Oct 30, 2020
Follow-up to #7205, per my comment in #7254:
#7254 (comment)

Instead of tearing down this.currentObservable only when
this.getOptions().skip is true in QueryData#removeQuerySubscription, I
split the tear-down functionality into a separate private method
(QueryData#removeObservable), which is now called everywhere
removeQuerySubscription is called, except in resubscribeToQuery, where we
specifically want to preserve this.observableQuery.
@brainkim
Copy link
Contributor

Don’t mind this comment, just leaving this for future me:

I came across this PR because I wanted to understand why we did this.observableQuery["tearDownQuery"](). I think the correct solution to this problem would have been to only add a query to the QueryManager in the ObservableQuery executor. 😣😖😫

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants