Sequence continuity
Marking sequences are monotonic feed-local identifiers, not dense counters.
Do not check:
current.sequence === last.sequence + 1n
Instead, check the signed pointer:
current.previousSequence === lastAcceptedSequence
Recommended consumer behavior:
| Situation | Action |
|---|---|
| First snapshot | Accept as current head |
| Sequence equals or below last accepted | Ignore as duplicate/reordered |
previousSequence matches last accepted | Accept as contiguous |
previousSequence does not match | Buffer briefly, then replay/resync |
Short bursts can arrive out of order. A robust consumer uses a small reorder window before reporting an unresolved gap.
If a gap remains unresolved, reconnect with the last accepted sequence for each feed or request bounded history.