mirror of
https://github.com/block/buzz.git
synced 2026-11-05 00:41:28 +00:00
The single-per-root frontier snapshot made thread-unread badges flaky: reading an ancestor or re-entering a channel could clear a descendant's badge, and the open-time snapshot was a second source of truth for the same read-line (the original Face-2 bug). Replace it with per-message msg:<id> markers read live through getReadAt: a reply lights iff createdAt > effective(msg:<id>), so reading one reply never clears another. Open and expand now mark ONLY the revealed set read (direct children), deliberately reversing #1118's whole-subtree-on-open — a collapsed branch keeps its badge until revealed. Mark-read/mark-unread are symmetric over a message + its subtree; mark-unread is a session-local OR-overlay since markers are monotonic. Deletes the frontier/seed layer (threadBadgeFrontier.ts) and the orphaned subtree-max open-ceiling path (subtreeMaxCreatedAt) rather than re-keying them. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>