Skip to main content

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 #

  1. Reconnect to /v1/sessions/{session_id}/stream?last_seq=N with the subprotocol dicon.v1 and the same key, where N is the last seq you processed. A session id is not a key; the handshake needs your key as any connection does.
  2. The server replays every kept event after N in order, with no duplicates and no gaps, then sends session.resumed with replayed_events, then continues live. seq keeps increasing across the whole session.
  3. The server keeps only a limited number of recent events per session. If an event after N is no longer kept, or N is beyond the newest event, it sends an error and closes with 4410. 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 server
  • 4404 — unknown, completed or cancelled session, or not yours
  • 4409 — session already attached to another live connection
  • 4410 — events after last_seq are 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.