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

Require cache.reset({ discardWatches: true }) to clear cache.watches #8852

Merged
merged 2 commits into from
Sep 27, 2021

Conversation

benjamn
Copy link
Member

@benjamn benjamn commented Sep 27, 2021

As reported in issue #8851 by @tm1000, PR #8826 (shipped in v3.4.14) was a breaking change for code expecting cache.watches to be restarted after cache.reset() is called.

This commit establishes a small but extensible Cache.ResetOptions API for the cache.reset method, which allows the handling of watches to be configured via options.discardWatches, which defaults to false, thus restoring the behavior of cache.reset() from before #8826.

If you need the behavior introduced by #8826, you can now opt (back) into that behavior by calling

cache.reset({ discardWatches: true })

As reported in issue #8851, PR #8826 was a breaking change for code
expecting cache.watches to be restarted after cache.reset() is called.

This commit establishes a small but extensible Cache.ResetOptions API
for the cache.reset method, which allows the handling of watches to be
configured via options.discardWatches, which defaults to false, thus
restoring the behavior of cache.reset() from before #8826.

If you need the behavior introduced by #8826, you can now opt (back)
into that behavior by calling cache.reset({ discardWatches: true }).
@benjamn benjamn added this to the v3.4.x patch releases milestone Sep 27, 2021
@benjamn benjamn self-assigned this Sep 27, 2021
@benjamn benjamn linked an issue Sep 27, 2021 that may be closed by this pull request
@benjamn benjamn changed the title Require cache.reset({ discardWatches: true }) to clear cache.watches. Require cache.reset({ discardWatches: true }) to clear cache.watches Sep 27, 2021
@benjamn benjamn merged commit 2f3260b into main Sep 27, 2021
@benjamn benjamn deleted the issue-8851-revert-clearing-watches-in-cache.reset branch September 28, 2021 16:13
benjamn added a commit that referenced this pull request Sep 30, 2021
Follow-up to PR #8852, inspired by this discussion: #8872
benjamn added a commit that referenced this pull request Sep 30, 2021
Follow-up to PR #8852, inspired by this discussion: #8872
benjamn added a commit that referenced this pull request Oct 4, 2021
Follow-up to PR #8852, inspired by this discussion: #8872
@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
💸 caching ⏮ compatibility backwards compatibility-related issues and PRs 🧪 has-tests 📟 regression
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression PR 8826 broke cache.reset()
2 participants