What Server-Sent Events guarantee, and what an Android client has to build on top. A dead server sends no FIN, so liveness needs a heartbeat and a watchdog. Resume needs both sides: monotonic ids and a retention buffer on the server, Last-Event-ID on the client. Reconnect policy lives in one pure reducer you can test as data. Plus backpressure recipes, going offline mid-shift, lifecycle, and SSE vs WebSocket.
Presented at DroidKaigi 2026 (September 2, 2026) in Tokyo, Japan.
Topics covered:
- What SSE guarantees vs what your client must build
- okhttp-sse: no reconnect, no resume, and the retry hint it drops
- Heartbeat + watchdog: the read-timeout trap
- Last-Event-ID resume, on the wire
- Four server bugs from open-source work on the Rage framework, four client rules
- The reconnect state machine as one pure function
- Backpressure: conflate gauges, bound logs
- Offline, lifecycle, and an honest screen
- SSE vs WebSocket for one-way monitoring
Code, tests and the chaos server: https://github.com/jsxs0/sse-survival-kit-android
GitHub: https://github.com/jsxs0
X/Twitter: https://x.com/SJasveen