fix(client): ensure data is yielded from buffer after stream ends (#126)

This commit is contained in:
Vedat Baday 2025-03-18 09:40:34 -07:00 committed by GitHub
parent 41679e2bd4
commit f76d430567
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -319,7 +319,7 @@ export class FalStream<Input, Output> {
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;