From f76d43056753be206f079bd6cc1d5296243a701d Mon Sep 17 00:00:00 2001 From: Vedat Baday <54285744+badayvedat@users.noreply.github.com> Date: Tue, 18 Mar 2025 09:40:34 -0700 Subject: [PATCH] fix(client): ensure data is yielded from buffer after stream ends (#126) --- libs/client/src/streaming.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/client/src/streaming.ts b/libs/client/src/streaming.ts index c618ccf..0303f97 100644 --- a/libs/client/src/streaming.ts +++ b/libs/client/src/streaming.ts @@ -319,7 +319,7 @@ export class FalStream { const stopAsyncIterator = () => (running = false); this.on("error", stopAsyncIterator); this.on("done", stopAsyncIterator); - while (running) { + while (running || this.buffer.length > 0) { const data = this.buffer.shift(); if (data) { yield data;