Severity: P2 · Effort: M · Risk: MED (Durable Object streaming) · Category: bug
Plan: plans/008-sse-backlog-ordering.md
Why this matters
StateStreamHub.watch() adds the client's writer to the broadcast set before replaying the backlog. A /notify broadcast arriving during the (awaited, D1-backed) backlog drain writes to that same writer — interleaving a new event among, possibly ahead of, older backlog events. An event present in both the backlog query and the concurrent broadcast is delivered twice.
This breaks the ordered, gap-free replay contract implied by after/Last-Event-ID (id: <sequence> lines). Clients tracking sequence see regressions or duplicates.
Blocked on a deeper bug
Plan 008's target design preserves the await-before-return structure that causes the deadlock in the linked issue below, so the plan as written is unimplementable — its own regression test would hang. Both are being fixed together, since the ordering fix is unreachable without the deadlock fix.
From automated audit 2026-07-17.
Severity: P2 · Effort: M · Risk: MED (Durable Object streaming) · Category: bug
Plan:
plans/008-sse-backlog-ordering.mdWhy this matters
StateStreamHub.watch()adds the client's writer to the broadcast set before replaying the backlog. A/notifybroadcast arriving during the (awaited, D1-backed) backlog drain writes to that same writer — interleaving a new event among, possibly ahead of, older backlog events. An event present in both the backlog query and the concurrent broadcast is delivered twice.This breaks the ordered, gap-free replay contract implied by
after/Last-Event-ID(id: <sequence>lines). Clients trackingsequencesee regressions or duplicates.Blocked on a deeper bug
Plan 008's target design preserves the await-before-return structure that causes the deadlock in the linked issue below, so the plan as written is unimplementable — its own regression test would hang. Both are being fixed together, since the ordering fix is unreachable without the deadlock fix.
From automated audit 2026-07-17.