Skip to main content

mark_read

Function mark_read 

Source
pub async fn mark_read(
    pool: &SqlitePool,
    did: &str,
    entry_id: i64,
    read: bool,
) -> Result<bool>
Expand description

Mark a single entry read/unread for a DID, upserting the per-DID state row and stamping updated_at. Preserves any existing starred bit. Also projects the change into the per-(did, feed_url) ReadCursor and marks it dirty so the batched flusher pushes it to the PDS (see [project_entry_into_cursor]).

AUTHORIZED per-DID: the upsert only touches an entry the caller subscribes to (sub_ref). Returns true if a row was written, false if did does not subscribe to the entry’s feed (the web layer maps that to a 404 — a non-subscriber can never mutate another user’s state).