A message sent into a dead socket ended up as failed — attachments even
stayed on "sending" forever — and only the user could send it again by
hand. Mobile NAT drops idle TCP silently, so neither side knew.
- pingInterval on the WebSocket, so the client notices a dead link itself
- outbox: after every reconnect, stuck messages are re-sent (batch of 30,
up to a day old); permanent errors are not retried
- sendAttachment gained the try/catch it was missing, otherwise the
attachment never reached the outbox
- de-duplicate by message id: a retry re-sends the SAME message, which
would otherwise show up twice on the other side