Unread

Each thread has a monotonic activitySeq. Each viewer has a readSeq for that thread. A missing read row means readSeq is 0, so existing discussion is unread until that viewer marks it.

unreadCount for viewer V is the number of comments where authorId is not V, deletedAt is null, and seq is greater than readSeq. Your own comments do not create a badge for you.

  • Creating a thread increments activitySeq and sets the author's readSeq to the root seq.
  • A reply increments activitySeq and leaves the author's readSeq unchanged.
  • Edits, resolve, reopen, and deletion do not increment activitySeq and do not create unread badges.
  • markRead moves readSeq forward only, to min(visibleSeq, activitySeq). visibleSeq is the highest seq the client actually rendered.

The widget calls markRead when the thread is open and those comments are on screen. Listing threads and background refresh do not call it. A reply does not prove the latest page was visible, so posting does not advance readSeq past comments the viewer has not rendered.

Deleting the last other-authored comment above the marker clears the badge without moving readSeq. A tombstone the viewer never opened does not keep a badge.

Thread filter unread means unreadCount > 0 for this viewer, applied in the query before the page limit. Guide: unread state.

Related: Threads and updates · Deletion · Adapter