Expand description
Delivery-window retention (design: docs/mail4agent/messenger-model.md, “Server is a router”). The server is not an archive: a message event is only needed until every live device of every joined member has fetched it.
record_device_ack— a/sync?since=s<N>proves the device holds every event up to stream idN(additive tabledevice_acks).retention_report— how many message events a purge would drop.purge_delivered_events— drops them. NOT scheduled anywhere: the owner decides when to switch it on (it changes what/rooms/{id}/messagescan return, see the design doc).
Only non-state events of CLOSED rooms are ever touched: plaintext public
channels live in pub_events (crate::public_channels) and are excluded
here by construction and by predicate.
Only non-state events are ever touched. State, keys, membership and
to-device queues are untouched here.
Structs§
- Retention
Policy - Retention knobs.
- Retention
Report - What a purge would do right now.
Constants§
- PURGE_
BATCH - Most events one purge pass removes (keeps the DB lock short).
Functions§
- create_
retention_ schema device_acksDDL. Called frominit_messenger_db.- purge_
delivered_ events - Deletes eligible message events (and rows pointing at them). Returns how many events were removed.
- record_
device_ ack - Records that
device_idhas received everything up tostream_id. Monotonic: an older token never moves the ack back. - retention_
report - Counts message events and how many a purge would delete.