Skip to main content

async-dedup-race-in-streaming-pipelines

Stars9
Forks2
UpdatedMarch 10, 2026 at 08:02

Fix invisible/broken rendering when streaming deduplicated results through SSE or WebSocket pipelines with async enrichment. Use when: (1) a counter/count shows items exist but UI renders nothing or fewer items than expected, (2) Svelte keyed {#each} or React key-based lists show blank despite array having items, (3) streaming pipeline uses async processing per item with a dedup Map/Set check before the await, (4) fire-and-forget async calls with Promise.then() lose results when parent stream closes. Root cause: dedup check happens before async gap, allowing concurrent calls for the same key to all pass, producing duplicate emissions. Secondary cause: onDone/stream-close fires before all async promises resolve, silently dropping late results.

Installation

Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.

SKILL.md
readonly