Deletion and retention
What deleting a message does#
Deleting a message removes it from every channel, thread, search result, pinned list and saved list immediately, and releases its attachments. Specifically:
- The message itself is kept as an empty tombstone rather than a row that is gone. The row holds no text, no attachment and nothing anyone wrote; what it still holds is an id, an author and a timestamp, which is what lets a reply posted under it keep resolving.
- Replies are deleted with the message that started their thread — every
reply, whoever wrote it, exactly as if each had been deleted on its own: words
blanked, attachments released, and their copies in the event log redacted. The
thread drops out of the followed list and asking for it returns
thread_not_found. Deleting the message you opened a conversation with therefore deletes everyone else's answers to it, which is worth knowing before deleting the top of a long thread. Deleting a single reply leaves the rest of the thread alone. - Attachments are removed from the database with the message and their bytes are deleted from disk by a queue that retries until it succeeds. A file locked by the operating system can survive on disk for a few minutes; the download API stops serving it the moment the deletion commits.
- Pins, saves and reactions pointing at it are deleted outright.
- The search index loses the text as part of the same write. SQLite marks the
freed index pages reusable rather than overwriting them, so the words can
remain in unallocated space inside
workspace.dbuntil something else writes over them.VACUUMon a stopped server rewrites the file without them. - The event log loses the text and the attachment names too. The events themselves stay — a missing sequence number would look to a catching-up client exactly like a log it had fallen off the end of, and send it back for a whole new snapshot — but what they replay is a message with nothing in it, followed immediately by the deletion.
- Editing a message does the same to every earlier version of it. Taking back a sentence by editing it away is the usual way people do it, and leaving the first draft in the log would make the correction cosmetic.
- App events still waiting to be delivered, or that gave up, lose the words too, on edit, deletion and retention alike; the events stay so each app still receives them in order. An event already delivered belongs to that app and cannot be recalled, and one on its way out at that moment may still arrive as it was. See Integration API contract.
- The request log never held the text: the server logs methods, paths and status codes, not bodies.
- Backups taken before the deletion still contain the original text, in full. Nothing this server does reaches into a backup you have already made. If a deletion has to be permanent, the backups from before it have to go too.
A message under an Enterprise legal hold cannot be deleted, and an edit of one keeps the words it replaced; see Compliance.
There is no account deletion. An account can be deactivated, which ends its sessions and stops it signing in, and what it wrote stays where it is.
Keeping less history#
ownbase-server --data ./data --retention-days 365
Off by default: a workspace that quietly started discarding history would be
worse than one that grows. Also settable with OWNBASE_RETENTION_DAYS. The
server prints the window on every start, because a setting that deletes things
is one to be reminded of.
An hourly sweep removes conversation older than the window outright — rows, attachments, pins, saves, reactions, and the text in the event log — rather than hiding it. A thread ages out as one thing: a root is taken only once its newest reply is past the window too, so nobody is left with replies hanging under nothing. Each pass removes at most 5,000 messages, counting replies, taking the oldest threads first; a single thread larger than that goes whole, on its own. The hourly sweep runs passes back to back, giving other requests the server between them, until nothing is left or it has run for 30 seconds, and the rest follow on the next hour. A sweep that fails is logged as an error and tried again on the next hour; it does not stop the server.
Nothing is announced to connected clients. These messages are old enough that no screen is showing them, and announcing a year of deletions would put the events into the very log this is meant to keep small. A client scrolled that far back keeps what it already has until it next asks the server, which will not have it.
Messages under an Enterprise legal hold, and every thread one is in, are skipped whatever their age.
This is not reversible. Getting discarded conversation back means restoring a backup taken before the sweep ran. Decide the window before turning it on, take a backup, and remember that lowering it later discards everything the new window excludes on the next hour.
The event log is pruned separately and always: only the most recent 20,000 events are kept, which is what a client resyncs against. Falling behind that is not a loss of history — the client takes a fresh snapshot instead.