Expand description
Constants used throughout the offline-protocol crate.
Constants§
- ACK_
COALESCE_ MAX - How many frames one coalesced delivery ACK may answer. Five keeps a coalesced ACK inside one fragment at the 185-byte floor’s neighbour, the 512-byte fragment both phones negotiate: 264 bytes plus four 37-byte ids.
- ACK_
COALESCE_ WINDOW - The longest a delivery ACK waits to be coalesced with others to the same peer. Short against the 10-second acknowledgement timeout; long enough that at a few messages a second each ACK frame answers two or three.
- ACK_
FOR_ KEY - Metadata key for ACK messages indicating which message ID the ACK is for.
- ACK_
HOP_ COUNT_ KEY - Metadata key for ACK messages indicating the hop count.
- ACK_
MORE_ KEY - Metadata key on a delivery ACK that answers more than one frame: the ids
after the one in
ACK_FOR_KEY, comma-separated. Sent only to a peer that advertisedACK_COALESCED_V1, and never on anundecryptableanswer. A peer that ignores it still settles the first id, and the rest through their resends’ duplicate re-acknowledgement. - ACK_
STATUS_ KEY - Metadata key on an ACK that answers a frame without delivering it. Absent on an ordinary delivery ACK.
- ACK_
STATUS_ UNDECRYPTABLE ACK_STATUS_KEYvalue: the recipient can never decrypt the frame it names (a spent ratchet generation, a dead epoch, or the pending-decryption queue gave up on it). The sender resends the message once; it is nevermessage_delivered. Still a delivery ACK in shape, so a relay holding the frame drops it.- ACK_
TRANSPORT_ KEY - Metadata key for ACK messages indicating the transport used.
- CHUNK_
SIZE_ BLE - Chunk size for BLE file transfers (4 KB). Reduces BLE double-fragmentation: ~22 BLE fragments per chunk instead of ~240.
- CHUNK_
SIZE_ INTERNET - Chunk size for Internet file transfers (256 KB). Fewer round-trips over WebSocket where bandwidth is plentiful.
- DEFAULT_
CHUNK_ SIZE - Default chunk size for file transfers (32 KB).
- DEFAULT_
INITIAL_ TTL - Default time-to-live for messages.
- DEFAULT_
MEDIA_ WINDOW_ SIZE - Default maximum chunks in flight for media transfers.
- FLUSH_
BATCH_ LIMIT - Maximum messages to send in a single flush operation. Prevents blocking the process loop when many messages are pending.
- HISTORY_
CLEANUP_ BATCH_ SIZE - Number of messages to remove when history exceeds the maximum. This provides a buffer to avoid frequent cleanup operations.
- HOP_
COUNT_ EMA_ ALPHA - EMA alpha for hop count tracking.
- LATENCY_
EMA_ ALPHA - EMA (Exponential Moving Average) alpha for latency tracking.
- MAX_
CONCURRENT_ INTERNAL_ MEDIA_ TRANSFERS_ PER_ PEER - How many of a peer’s transfer slots the SDK’s own document-layer traffic may occupy at once.
- MAX_
CONCURRENT_ MEDIA_ TRANSFERS_ PER_ PEER - Maximum concurrent outbound media transfers per recipient when chunks are MLS-encrypted.
- MAX_
FORWARD_ COUNT - Maximum number of times a message may be forwarded. Prevents unbounded forwarding chains from malicious or buggy clients.
- MAX_
MEDIA_ DESCRIPTORS - Maximum persisted outbound media transfer descriptors restored after a
restart (newest-first). Small on purpose: each maps to a
MediaResendRequiredthe app is expected to act on, and concurrent transfers are already capped per peer. - MAX_
MEDIA_ OUTBOX_ ENTRIES - Maximum entries in the dedicated media outbox. Smaller than the main outbox since the sliding window limits in-flight chunks.
- MAX_
MESSAGE_ HISTORY - Maximum number of messages to keep in history for topology visualization. This prevents unbounded memory growth while maintaining enough history for accurate network statistics.
- MAX_
OUTBOX_ ENTRIES - Maximum number of entries in the outbox before evicting oldest entries. This prevents unbounded memory growth when messages cannot be delivered.
- MEDIA_
WINDOW_ SIZE_ BLE - Maximum chunks in flight for BLE media transfers. BLE’s low bandwidth means fewer concurrent chunks to avoid congestion.
- MEDIA_
WINDOW_ SIZE_ INTERNET - Maximum chunks in flight for Internet media transfers.
- NO_
ALERT_ KEY - Metadata key marking a frame the SDK sent on its own: control traffic, key packages, data-sync frames, receipts, typing, presence, and a 1:1 Welcome no user message is waiting on.
- OBSERVED_
STATS_ COMPACT_ THRESHOLD - Threshold for compacting observed stats to prevent unbounded growth.
- ORIGINAL_
CONTENT_ TYPE_ KEY - Metadata key carrying the original content type on file-chunk messages.
- OUTBOX_
ABSOLUTE_ LIFETIME_ FACTOR - Absolute cap on a restored outbox entry’s total lifetime, as a multiple
of
outbox_max_lifetime_ms, measured fromfirst_sent_at. - TRANSPORT_
PREFERENCE_ INTERNET - Transport preference value: prefer internet transport.
- TRANSPORT_
PREFERENCE_ KEY - Metadata key indicating preferred transport for a message.