Skip to main content

Module ephemeral

Module ephemeral 

Source
Expand description

Typing, receipts, and read markers. crate::typing::TypingRegistry is in memory. This module does not wake.

Structs§

ReadMarkersBody
TypingBody

Constants§

DEFAULT_TYPING_TIMEOUT_MS
Applied when a PUT .../typing/{userId} body omits timeout and typing: true — matches crate::typing::TypingRegistry::set_typing’s own clamp ceiling (its private TYPING_MAX_TIMEOUT_MS), so an omitted timeout behaves the same as the largest timeout a client could ask for.

Functions§

apply_read_markers
POST /read_markers’s whole DB-side decision (plan §4 read_markers row): Member, then m.fully_read (stored verbatim as per-room account data for the caller, waking only their own devices) and/or m.read/ m.read.private (each delegated to apply_receipt, which applies its own wake rule per type). Every field is independently optional — a call naming only one of the three touches only that one.
apply_receipt
POST /receipt/{receiptType}/{eventId}’s whole DB-side decision (plan §4 receipt row, and the m.read/m.read.private branches of POST /read_markers): Member, then the target event must be visible to the caller (crate::store::visible_upper_bound — for a joined member (the only membership this gate accepts) this is always crate::store::HistoryWindow::All unless a world_readable room’s event simply does not exist in THIS room at all, which the room-id filter below already catches), then crate::store::upsert_receipt’s own monotonic upsert. Returns None (no wake) when the upsert did not actually move the receipt forward — a backwards or repeat receipt is a silent no-op, detected here by comparing the receipt’s stream_id before and after the upsert, never by re-deriving the monotonic comparison a second time.
apply_typing
check_typing_target
expired_typing_wake_ids
require_member