fix: scope TimelineCache::forget() to single subject (#12)#20
Draft
AsmitNepali wants to merge 1 commit into1.xfrom
Draft
fix: scope TimelineCache::forget() to single subject (#12)#20AsmitNepali wants to merge 1 commit into1.xfrom
AsmitNepali wants to merge 1 commit into1.xfrom
Conversation
Replace store-wide flush() with per-subject key index. TimelineCache
now tracks cached keys in `{prefix}:{class}:{id}:index` and forget()
deletes only those keys plus the index entry, leaving sessions, queue
locks, and other application caches in the same store untouched.
Also updates docs to remove the "known limitation" callouts.
Fixes #12
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.
Summary
Fixes #12.
TimelineCache::forget()previously calledCache::store(...)->getStore()->flush(), wiping the entire cache store — sessions, queue locks, and other application caches sharing the store all got cleared.TimelineCachenow tracks every key it writes in a per-subject index entry andforget()deletes only those keys plus the index.Changes
src/Timeline/TimelineCache.php— newremember()method tracks keys under{prefix}:{class}:{id}:index;forget()reads the index and deletes only the recorded keys plus the index entry.src/Timeline/TimelineBuilder.php—paginate()now calls$cache->remember(...)so writes get indexed.tests/Feature/TimelineCacheTest.php— added two tests:forgetTimelineCache()5.caching.md,6.troubleshooting/1.index.md, and6.configuration.md.(This branch also carries unrelated docs/branding commits already merged into other PRs; the issue-#12 fix is the final commit
1ffb8f00.)Test plan
./vendor/bin/pest tests/Feature/TimelineCacheTest.php— 4 passed./vendor/bin/pestfull suite — 46 passed