Skip to main content

DEFAULT_PENDING_TTL_MS

Constant DEFAULT_PENDING_TTL_MS 

Source
pub const DEFAULT_PENDING_TTL_MS: u64 = 86_400_000;
Expand description

Default TTL for the pending-decryption queue (24 hours, in ms).

Under the deferred-ACK model an undecryptable message is no longer ACKed on receipt, so this queue is the primary recovery window before the session confirms — a 2-minute window was too short for a peer whose Welcome is slow to arrive/adopt, and 30 minutes was too short once the queue became durable: with a relay that pushes ciphertext without store-and-forward there is no second copy, so a frame that arrives while the recipient’s session is still being set up has to outlive the handshake, which for a phone that is opened once a day means a day. Memory stays bounded by the per-peer/global byte caps plus the DropOldest overflow policy; a longer TTL only lets entries linger within those caps, it does not raise the ceiling. The TTL is measured on an Instant and so restarts with the process; the persisted copy is bounded separately by PENDING_DECRYPT_PERSISTED_MAX_AGE_MS (7 days).

The UniFFI PendingQueueConfig default mirrors this value — reference this constant there rather than re-hardcoding it.