# Slow clients are stopped and resynced, never closed for lag Each connection has an app-level bounded outbox (byte and message caps) keyed by an app `connId`, with latest-state-wins coalescing per state key and the diff computed at flush time. WS `Ping(seq)`/`Pong` measures lag; a client over the cap or without a timely Pong stops being fed and is fully resynced when it recovers. Lag never closes a connection; a peer that never recovers is closed by the nginx proxy timeout. We chose this over closing slow clients because at the mummy 0.4.8 pin there is no per-socket queue visibility, no forced close, and `close(ws)` queues behind the backlog. ## Status accepted ## Alternatives - Patch or fork mummy for per-socket depth and forced close: fallback only, not planned. - Close a client when lag exceeds a bound: impossible at the pin, and it loses a phone that was briefly backgrounded. - Drop state messages with no resync: rejected, the client would silently diverge. ## Consequences Memory per connection is bounded by the caps; a stopped client's state is rebuilt from its `known` table on recovery, so a dropped intermediate state cannot desynchronise it. Ordering between a state message and an ack is flush order, not mutation order (ADR-0002). The connection limits (4 per player, 16 total) are enforced separately. ## Tickets Q13, #18, #15; research `docs/research/q13-mummy-slow-clients.md`. ## Spec Current §4.3, §6.3, §6.4.