Allow pausing/resuming tag collection and cache invalidation for specific code blocks - #49
Open
jdreesen wants to merge 3 commits into
Open
Allow pausing/resuming tag collection and cache invalidation for specific code blocks#49jdreesen wants to merge 3 commits into
jdreesen wants to merge 3 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
jdreesen
force-pushed
the
scope-control
branch
2 times, most recently
from
July 10, 2026 19:04
236bef0 to
e10e0a4
Compare
…to `CacheScope` Introduce `withoutCollecting` to temporarily pause tag collection and `withCollecting` to enable it within a given context. Introduce `isCollecting` to determine whether response tag collection is currently enabled.
Mirrors withoutCollecting()/withCollecting(): lets code temporarily pause cache invalidation for a block (e.g. a bulk import that saves many elements without wanting each save to invalidate), backed by its own pause flag independent of tag-collection pausing. Still respects disable(), same as withCollecting(). Also backfill a CHANGELOG entry for the withCollecting()/isCollecting() feature, which shipped without one. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
isEnabled() was never called by production code (the tagger and invalidator are wired to isCollecting()/isInvalidating()) and had become a partial predicate once collection could be paused: it says "enable() was called" without accounting for the pause, which isn't a distinction any caller actually needs. Fold it into isCollecting() directly and drop it from the public API. Rename $paused to $collectionPaused now that there's a second, independent pause flag ($invalidationPaused) for symmetry, and to make clear it only affects tag collection. Also fix a doc typo referencing a non-existent startCollecting() method. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
jdreesen
force-pushed
the
scope-control
branch
from
August 31, 2026 08:43
e10e0a4 to
0e37254
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
CacheScope::withoutCollecting()/withCollecting()to temporarily pause/resume response tag collection for a specific block of code, andisCollecting()to check whether collection is currently active.Adds the equivalent pair for cache invalidation:
withoutInvalidating()/withInvalidating(), useful e.g. to suppress invalidation around a bulk import that saves many elements.Removes
CacheScope::isEnabled(): it was never used by production code, and had become a partial predicate once collection could be paused (it ignored the pause).isCollecting()/isInvalidating()are now the only two supported predicates onCacheScope.Closes #41, #43