Skip to content

Commit 60406c5

Browse files
committed
docs: clarify fragment ordering assumptions for HTTP
Co-authored-by: lody <agent@lody.ai>
1 parent a66137d commit 60406c5

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

http-push-sse-protocol.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,13 @@ For SSE:
141141

142142
## Ordering and Concurrency
143143

144-
HTTP push requests can arrive concurrently, which can break assumptions about fragment ordering.
144+
HTTP push requests can arrive concurrently, so receivers may observe frames out of order (for example, a `DocUpdateFragment` arriving before its `DocUpdateFragmentHeader`).
145145

146146
Recommendations:
147147

148148
- Serialize push handling per session key.
149-
- Enforce that `DocUpdateFragmentHeader` is observed before accepting fragments for that batch (or buffer until header arrives).
149+
- Enforce that `DocUpdateFragmentHeader` is observed before accepting fragments for that batch (or buffer fragments until the header arrives).
150+
- Fragments within a batch SHOULD be reassembled by `index` and MAY be accepted out of order once the header is known.
150151
- Use existing batch IDs as the correlation key for both fragments and `Ack`.
151152

152153
## Loss Recovery on SSE Reconnect

0 commit comments

Comments
 (0)