Skip to content

Do not emit 'end' while parsed entries are still buffered - #363

Open
utrumo wants to merge 1 commit into
ZJONSSON:masterfrom
utrumo:fix/force-stream-end-after-buffered-entries
Open

utrumo wants to merge 1 commit into
ZJONSSON:masterfrom
utrumo:fix/force-stream-end-after-buffered-entries

Conversation

@utrumo

@utrumo utrumo commented Sep 30, 2026 •

Copy link
Copy Markdown

Fixes #191
Related to #234, #269, #273, #274

Downstream

Test plan

  • npm test: 108 passing, 1 pending (Node 24)
  • eslint lib test: clean

With forceStream, a consumer slower than the parser (a piped destination
under backpressure, or a 'data'/'end' based iterator such as the one in
exceljs) still has entries in the readable buffer when the writable side
finishes. Emitting 'end' manually at that point made pipe() end the
destination early and the remaining entries were silently lost.
Let the native 'end' fire once the buffer is drained instead.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Async iteration 2

1 participant