Skip to content

Commit

Permalink
Avoid momentarily creating nonexistent QueryInfo in QueryManager#remo…
Browse files Browse the repository at this point in the history
…veQuery.
  • Loading branch information
benjamn committed Mar 11, 2022
1 parent bb83bca commit 851bae2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/QueryManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -927,8 +927,10 @@ export class QueryManager<TStore> {
// A query created with `QueryManager.query()` could trigger a `QueryManager.fetchRequest`.
// The same queryId could have two rejection fns for two promises
this.fetchCancelFns.delete(queryId);
this.getQuery(queryId).stop();
this.queries.delete(queryId);
if (this.queries.has(queryId)) {
this.getQuery(queryId).stop();
this.queries.delete(queryId);
}
}

public broadcastQueries() {
Expand Down

0 comments on commit 851bae2

Please sign in to comment.