ReceiveResult

sealed interface ReceiveResult

Outcome of SecureMessageClient.decrypt (docs/message-reliability.md, docs/application-delivery.md).

Inheritors

Types

Link copied to clipboard
class Acknowledgement(val sender: DeviceAddress, val id: LogicalMessageId, val cleared: Boolean) : ReceiveResult

sender acknowledged message id: its application finalized it (committed or discarded; this device cannot tell which). cleared is true if it was pending for sender and is now removed; false for a repeated or unknown acknowledgement, or one for a message this device abandoned, which is harmless.

Link copied to clipboard
class AlreadyCommitted(val sender: DeviceAddress, val id: LogicalMessageId, val ackSent: Boolean) : ReceiveResult

A message the application already committed, sent again by sender (for example because the acknowledgement was lost). Its plaintext is not delivered again; it was acknowledged again (ackSent).

Link copied to clipboard
class AlreadyDiscarded(val sender: DeviceAddress, val id: LogicalMessageId, val ackSent: Boolean) : ReceiveResult

A message the application discarded, sent again by sender (for example because the acknowledgement was lost). Its plaintext is not delivered again (it is no longer stored); it was acknowledged again (ackSent). The sender cannot tell this from AlreadyCommitted.

Link copied to clipboard
class Delivery(val message: ReceivedMessage) : ReceiveResult

An application message the application has not finalized yet. It is not acknowledged: the sender keeps it pending until the application calls SecureMessageClient.commitReceivedMessage or SecureMessageClient.discardReceivedMessage. Returned again, with the same message, for every copy the sender retries before that.

Properties

Link copied to clipboard
abstract val id: LogicalMessageId
Link copied to clipboard
abstract val sender: DeviceAddress