Problem
After markAllRead, the success handler in src/lib/hooks/useEntryMutations.ts:370-384:
- Invalidates
utils.subscriptions.list (React Query cache)
- Invalidates
utils.entries.list (React Query cache)
- Refetches tags collection
- Calls
refreshGlobalCounts() for "all"/"starred"/"saved" counts
However, per-tag subscription collections (TagSubscriptionsCollection instances in the sidebar) are backed by separate query keys (["subscriptions-tag", filterKey]), which are NOT invalidated by utils.subscriptions.list.invalidate(). This means individual subscription unread counts in the sidebar remain stale until the user collapses and re-expands the tag section.
Fix
After markAllRead, also reset subscription unread counts in the global subscriptions collection (set all to 0 when markAllRead has no filter, or set filtered subscriptions to 0). Additionally, either invalidate the per-tag subscription collection queries or directly update the subscription objects in the per-tag collections.
Related to #580 (tanstack-db branch).
-- Claude
Problem
After
markAllRead, the success handler insrc/lib/hooks/useEntryMutations.ts:370-384:utils.subscriptions.list(React Query cache)utils.entries.list(React Query cache)refreshGlobalCounts()for "all"/"starred"/"saved" countsHowever, per-tag subscription collections (
TagSubscriptionsCollectioninstances in the sidebar) are backed by separate query keys (["subscriptions-tag", filterKey]), which are NOT invalidated byutils.subscriptions.list.invalidate(). This means individual subscription unread counts in the sidebar remain stale until the user collapses and re-expands the tag section.Fix
After markAllRead, also reset subscription unread counts in the global subscriptions collection (set all to 0 when markAllRead has no filter, or set filtered subscriptions to 0). Additionally, either invalidate the per-tag subscription collection queries or directly update the subscription objects in the per-tag collections.
Related to #580 (tanstack-db branch).
-- Claude