Tradeoff 01
Low Latency + Battery
Persistent WebSocket + Push Wake vs. HTTP Long Polling
check_circleChosen: WS + Push Wake
Single multiplexed TCP socket while foregrounded; OS push wakes the app cleanly when suspended.
cancelRejected: Long Polling
Repeated HTTP/TLS handshakes and header overhead drain cellular battery and inflate tail latency.
Why It Wins: Cuts wire overhead by >85% during active conversations while keeping background radio wakeups within the < 2% / hr battery envelope.
Tradeoff 02
Deterministic Order
Server Monotonic Sequence (server_seq) vs. Client Wall-Clock
check_circleChosen: server_seq
Per-conversation monotonic integers make gaps immediately detectable (seq > hwm + 1) and ordering total.
cancelRejected: Client Clocks
Manual time-zone changes, NTP drift, and offline sends cause scrambled threads and silent message loss.
Why It Wins: Local optimistic messages render at the tail until ACKed, then snap cleanly to their canonical server_seq without missing packets.
Tradeoff 03
Zero HoL Blocking
Upload-Then-Send Encrypted Pointer vs. Inline Media Over WS
check_circleChosen: Blob + Pointer
256 KB encrypted chunks upload over HTTP PATCH; only a ~250B media_ptr rides the chat WebSocket.
cancelRejected: Inline WS Blob
A 4.2 MB video blocks text messages and heartbeat PINGs behind head-of-line TCP congestion.
Why It Wins: Keeps text chats snappy (<350ms p99), enables byte-range resume across Wi-Fi/5G switches, and offloads heavy egress to Edge Blob CDNs.
Tradeoff 04
Zero-Knowledge
Client-Side E2EE vs. Server-Side Full-Text Search
check_circleChosen: Client E2EE + FTS
Messages stay end-to-end encrypted in transit and on relay; local SQLite FTS5 indexes decrypted history on device.
cancelRejected: Server Indexing
Requires plaintext access on relay servers, breaking end-to-end privacy guarantees and expanding breach blast radius.
Why It Wins: Preserves strict zero-knowledge privacy while delivering instant offline search over years of local conversation history.