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
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Keep ObservableQuery#tearDownQuery private, and make it idempotent.
  • Loading branch information
benjamn committed Oct 22, 2020
commit a60b81b3bb56887b6bd972aa96a5db38e4022fdb
4 changes: 3 additions & 1 deletion src/core/ObservableQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,9 @@ once, rather than every time you call fetchMore.`);
return this.observers.size > 0;
}

public tearDownQuery() {
private tearDownQuery() {
if (this.isTornDown) return;
kamilkisiela marked this conversation as resolved.
Show resolved Hide resolved

const { queryManager } = this;

if (this.reobserver) {
Expand Down
2 changes: 1 addition & 1 deletion src/react/data/QueryData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ export class QueryData<TData, TVariables> extends OperationData {
this.currentSubscription.unsubscribe();
delete this.currentSubscription;
} else if (this.currentObservable && this.getOptions().skip) {
this.currentObservable.tearDownQuery();
this.currentObservable["tearDownQuery"]();
}
}

Expand Down