From 0c29c76a8aa819bea948968c1f65ff30fa18d2ee Mon Sep 17 00:00:00 2001 From: Diego Resendez Date: Sun, 28 Jun 2026 13:37:33 -0500 Subject: [PATCH] fix(http): flush SSE headers immediately so idle subscriptions don't deadlock clients Signed-off-by: Diego Resendez --- src/http.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/http.ts b/src/http.ts index 840a9be..adf4252 100644 --- a/src/http.ts +++ b/src/http.ts @@ -91,6 +91,7 @@ async function pipeStream( bus?: Bus, name = '', streams?: Set<() => void>, ): Promise { res.writeHead(200, encoder.headers); + res.flushHeaders(); // establish the stream immediately so idle-until-event sources (e.g. subscriptions) don't deadlock clients awaiting headers bus?.emit('stream:open', { name }); const it = stream[Symbol.asyncIterator](); let ping: ReturnType | undefined;