The reaper counts read marks and pins of people who no longer subscribe #156

Closed
opened 2026-10-08 18:36:23 -07:00 by rays · 1 comment
Owner

Found in a code audit on 2026-10-09.

The reaper's candidates (Db::reap_candidates, src/db.rs:789-807) count read marks and pins in entry_state from anyone, and the subscribers from subscriptions. Unsubscribing leaves your entry_state rows behind, and POST /api/entries/{feed}/{guid}/flags writes them for feeds you do not subscribe to as well.

  • Read early: B subscribes to a feed and has not played an episode; A has, and so had C before unsubscribing. Two readers against two subscribers reads as "everyone has heard it", so under the quota B's unplayed episode goes before files everyone has finished.
  • Kept forever: an item pinned by someone who has since unsubscribed is never offered at all, and its entry is never pruned (prune_entries, src/db.rs:945-948, same rule). Enough of them and the quota cannot be met.

Fix: count only the state of people who subscribe to the item's feed, in both queries.

Found in a code audit on 2026-10-09. The reaper's candidates (`Db::reap_candidates`, `src/db.rs:789-807`) count read marks and pins in `entry_state` from anyone, and the subscribers from `subscriptions`. Unsubscribing leaves your `entry_state` rows behind, and `POST /api/entries/{feed}/{guid}/flags` writes them for feeds you do not subscribe to as well. - Read early: B subscribes to a feed and has not played an episode; A has, and so had C before unsubscribing. Two readers against two subscribers reads as "everyone has heard it", so under the quota B's unplayed episode goes before files everyone has finished. - Kept forever: an item pinned by someone who has since unsubscribed is never offered at all, and its entry is never pruned (`prune_entries`, `src/db.rs:945-948`, same rule). Enough of them and the quota cannot be met. Fix: count only the state of people who subscribe to the item's feed, in both queries.
rays added the bug label 2026-10-08 18:36:23 -07:00
Author
Owner

Fixed in 60cbb7a: the reaper's candidates and prune_entries count only the read marks and pins of people who subscribe to the item's feed. Test: the_marks_of_someone_who_left_count_for_nothing. Deployed as 0.10.3-dev on 2026-10-09.

Fixed in 60cbb7a: the reaper's candidates and prune_entries count only the read marks and pins of people who subscribe to the item's feed. Test: the_marks_of_someone_who_left_count_for_nothing. Deployed as 0.10.3-dev on 2026-10-09.
rays closed this issue 2026-10-08 18:58:44 -07:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rays/ipx#156