Resume
Reattach to a session after a dropped connection and receive the events you missed. Resume is off unless the service enables it.
When resume is off, a reconnect with last_seq is refused with 4400.
Reattach and replay #
- Reconnect to
/v1/sessions/{session_id}/stream?last_seq=Nwith the subprotocoldicon.v1and the same key, whereNis the lastseqyou processed. A session id is not a key; the handshake needs your key as any connection does. - The server replays every kept event after
Nin order, with no duplicates and no gaps, then sendssession.resumedwithreplayed_events, then continues live.seqkeeps increasing across the whole session. - The server keeps only a limited number of recent events per session. If an event after
Nis no longer kept, orNis beyond the newest event, it sends anerrorand closes with4410. It never replays part of the history; start a new session.
Grace window #
A detached session waits for a limited time, set by the service, and is cancelled if nobody reattaches. The idle timeout on Limits may end it sooner.
Refusal close codes #
A refused resume sends one error event, then closes with:
4400— resume is off on this server4404— unknown, completed or cancelled session, or not yours4409— session already attached to another live connection4410— events afterlast_seqare not retained; start a new session
A reconnect without last_seq gets no replay; it closes 4409 if the session is attached elsewhere or is not yours.
Resume stays on one server #
A reattach reaches only the server holding the session. If that server is replaced, the session is lost; start a new one.