ProcessedInboundStore

Terminal tombstones of the logical messages the application committed or discarded, for duplicate suppression (docs/message-reliability.md, docs/application-delivery.md, docs/message-discard.md). Keyed by (sender, logical ID): the same ID from another sender is a different message. An entry is never replaced, so its outcome never changes; entries are removed only by pruneFinalizedAtOrBefore.

The digest is sensitive (a fingerprint of the message content): persistent adapters encrypt it at rest. Finalization, time and discard reason are plaintext metadata.

Functions

Link copied to clipboard
abstract suspend fun get(sender: DeviceAddress, id: LogicalMessageId): ProcessedInboundMessage?
Link copied to clipboard
abstract suspend fun isProcessed(sender: DeviceAddress, id: LogicalMessageId): Boolean

Whether id from sender is recorded, with either outcome. Never opens a stored record.

Link copied to clipboard
abstract suspend fun markCommitted(sender: DeviceAddress, id: LogicalMessageId, digest: ByteArray, committedAt: Instant)

Records id from sender as InboundFinalization.COMMITTED with the body digest (32 bytes) and the commit time. Throws IllegalArgumentException if it is already recorded, with either outcome: an entry is never replaced.

Link copied to clipboard
abstract suspend fun markDiscarded(sender: DeviceAddress, id: LogicalMessageId, digest: ByteArray, discardedAt: Instant, reason: MessageDiscardReason)

Records id from sender as InboundFinalization.DISCARDED with the body digest (32 bytes), the discard time and reason. Throws IllegalArgumentException if it is already recorded, with either outcome: an entry is never replaced.

Link copied to clipboard
abstract suspend fun pruneFinalizedAtOrBefore(cutoff: Instant): Int

Removes every entry, committed or discarded, finalized at or before cutoff and returns their number. Entries without a finalization time are kept. Never touches pending messages.

Link copied to clipboard
abstract suspend fun stampLegacyCommitTimes(at: Instant): Int

Sets the commit time of every entry without one (recorded before milestone 20) to at. Never changes a time already set. Returns the number of entries stamped.