Skip to content

Commit 39af45c

Browse files
committed
Explain resumability
1 parent 66a1cdd commit 39af45c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

docs/specification/draft/basic/transports.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,17 @@ and maintenance of session state across separate POSTs.
141141
- The client **MUST** be resilient to duplicate _notifications_, handling them with
142142
idempotency.
143143

144+
### Resumability and Redelivery
145+
146+
To support resuming broken connections, and redelivering messages that might otherwise be lost:
147+
148+
1. Servers **MAY** attach an `id` field to their SSE events, as described in the [SSE standard](https://html.spec.whatwg.org/multipage/server-sent-events.html#event-stream-interpretation).
149+
- If present, the ID **MUST** be globally unique across all streams within that [session](#session-management)—or all streams with that specific client, if session management is not in use.
150+
2. After a broken connection, clients **MAY** include a [`Last-Event-ID`](https://html.spec.whatwg.org/multipage/server-sent-events.html#the-last-event-id-header) header when opening a new SSE stream, to indicate the last event ID they received.
151+
- The server **MAY** use this header to replay messages that were sent after the last event ID, and to resume the stream from that point.
152+
3. Clients **MUST NOT** include a `Last-Event-ID` header when connecting _additional_ SSE streams within the session, while at least one remains connected.
153+
- The server **SHOULD** interpret the presence of this header as indicating that any other streams which _nominally_ remain open are in fact dead, and should be terminated.
154+
144155
### Sequence Diagram
145156

146157
```mermaid

0 commit comments

Comments
 (0)