fix(task-history): route invalidate() and invalidateAll() through withLock#912
fix(task-history): route invalidate() and invalidateAll() through withLock#912morgan-coded wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughTask history invalidation now runs through the write lock. ChangesTask history cache consistency
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Locks
invalidate()andinvalidateAll()behindTaskHistoryStore's existingwithLockqueue so cache invalidation cannot interleave with an in-flight mutation. Each method keeps its existing cache behavior.Related GitHub Issue
Fixes #698
Description
Per your note, I routed
invalidate()rather than removing it: the census found no non-test callers, butTaskHistoryStoreis exported from the task-persistence barrel, so deleting its public method could break consumers.invalidate()TaskHistoryStorewithLockinvalidateAll()TaskHistoryStorewithLockTest Procedure
The regression blocks
writeTaskFilewith a manually controlled promise after the lock is acquired, callsinvalidateAll(), then releases the write. It asserts thatonWritesees both cached tasks before the queued invalidation clears the final cache, so no timer or scheduling delay controls the result.pnpm --filter zoo-code exec vitest run core/task-persistence/__tests__/TaskHistoryStore.spec.tspnpm testpnpm lintpnpm check-typesPre-Submission Checklist
Additional Notes
Non-goals: no other cache methods, lock implementation, callers, or APIs are changed.
Summary by CodeRabbit
Bug Fixes
Tests