-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reactivate reactive variables when InMemoryCache gets new watchers.
Fixes a bug introduced by #7279, which was triggered by calling this.cancel() before re-watching in the QueryInfo#updateWatch method, causing cache.watches.size to drop to zero temporarily, thereby invoking forgetCache(cache). When this happened, reactive variables would stop broadcasting updates to the forgotten cache, even though the unwatching was only momentary, and would not begin broadcasting again until the association was reestablished by other means. This new implementation uses a WeakMap to remember the association between caches and sets of reactive variables, which makes it possible to recall those associations later, provided the cache has not been garbage collected in the meantime.
- Loading branch information
Showing
2 changed files
with
29 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters