Skip to content

Allow pausing/resuming tag collection and cache invalidation for specific code blocks - #49

Open
jdreesen wants to merge 3 commits into
scope-cache-activationfrom
scope-control
Open

Allow pausing/resuming tag collection and cache invalidation for specific code blocks#49
jdreesen wants to merge 3 commits into
scope-cache-activationfrom
scope-control

Conversation

@jdreesen

@jdreesen jdreesen commented Jul 10, 2026

Copy link
Copy Markdown
Member

Adds CacheScope::withoutCollecting()/withCollecting() to temporarily pause/resume response tag collection for a specific block of code, and isCollecting() 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 on CacheScope.

Closes #41, #43

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c6a474ec-5b7a-4a2b-9639-f01231a6c543

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch scope-control

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jdreesen
jdreesen force-pushed the scope-control branch 2 times, most recently from 236bef0 to e10e0a4 Compare July 10, 2026 19:04
@jdreesen
jdreesen requested a review from jan888adams July 10, 2026 19:05
jdreesen and others added 3 commits August 31, 2026 10:24
…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 jdreesen changed the title Allow pausing/resuming tag collection for specific code blocks Allow pausing/resuming tag collection and cache invalidation for specific code blocks Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant