saveMeta

abstract suspend fun saveMeta(docKey: String, bytes: ByteArray)

Records the post-sync header. It leaves the snapshot alone — an online client syncs constantly, and re-snapshotting per sync would reintroduce the cost this interface exists to avoid — and it leaves the log alone too.

That second part is load-bearing. The log does two jobs: it holds un-pushed changes so they survive a reload, and it is the delta between the snapshot and the document's current content. Deleting acknowledged entries serves the first job and destroys the second, because nothing brings the snapshot forward on a push-ack — the content would then exist in neither place while the persisted serverSeq claims the server has it. Only compaction trims the log, and it does so by folding the entries into a new snapshot first.

It is a no-op when nothing is stored for docKey.