Skip to content

Commit

Permalink
Cancel pending notify timeouts when stopping QueryInfo objects (#7935)
Browse files Browse the repository at this point in the history
  • Loading branch information
hollandThomas authored Apr 5, 2021
1 parent 0b1b8e7 commit 1d441ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
- Prevent `RenderPromises` memory leak by calling `renderPromises.clear()` after `getMarkupFromTree` finishes. <br/>
[@benjamn](https://github.com/benjamn) in [#7943](https://github.com/apollographql/apollo-client/pull/7943)

- Cancel pending notify timeout when stopping a `QueryInfo` object. <br/>
[@hollandThomas](https://github.com/hollandThomas) in [#7935](https://github.com/apollographql/apollo-client/pull/7935)

## Apollo Client 3.3.13

### Improvements
Expand Down
3 changes: 3 additions & 0 deletions src/core/QueryInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ export class QueryInfo {
if (!this.stopped) {
this.stopped = true;

// Cancel the pending notify timeout
this.reset();

this.cancel();
// Revert back to the no-op version of cancel inherited from
// QueryInfo.prototype.
Expand Down

0 comments on commit 1d441ce

Please sign in to comment.