Files
buzz/migrations/0058_personal_read_through_message.sql
Honey fd03e1834f feat(relay): reshape read-state API to the sidebar wire format
The counting implementation is unchanged; this changes what /buzz/v1 takes
and returns so later upgrades land in place.

- Sidebar rows are { channel_id, unread, mentions, read_through_id,
  latest_id, threads }; thread rows are { root_id, unread, mentions,
  read_through_id, latest_id }. Channel unread/mentions count top-level
  messages only, and the channel latest_id is the last top-level message
  (never a reply or an unresolved reply), so a channel mark_through can
  always use it. Exactness (exact/at_least/unknown), channel metadata and
  `account` are no longer on the wire.
- POST /me/read-state returns the updated rows of the channels it applied
  to. mark_channel_read and the explicit-contexts read are removed.
- Migration 0058 records each frontier's anchor message id (reported as
  read_through_id) and drops the whole-channel threads cut.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Honey <8e307ae0076a4dab6b94b036ea3edc7e08f823a625269c1e6919e881a048b4d2@buzz.block.builderlab.xyz>
2026-10-08 12:38:30 -07:00

8 lines
406 B
SQL

-- A frontier records the message it was read through, so the sidebar can
-- report it. NULL for frontiers written before this column. Channel and thread
-- frontiers are independent: the whole-channel cut covering every thread is
-- gone.
ALTER TABLE personal_read_frontiers
ADD COLUMN through_message_id BYTEA CHECK (octet_length(through_message_id) = 32),
DROP COLUMN threads_through_timestamp;