Skip to content

stream: fix dropped first chunk in Utf8Stream buffer mode#63833

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
watilde:buffer-fix
Jun 16, 2026
Merged

stream: fix dropped first chunk in Utf8Stream buffer mode#63833
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
watilde:buffer-fix

Conversation

@watilde

@watilde watilde commented Jun 10, 2026

Copy link
Copy Markdown
Member

In buffer content mode, #writeBuffer pushed an empty array when starting a new batch (including the very first write), so the data buffer was never stored while its length was still recorded in lens. The first write then emitted zero bytes and the misaligned bufs/lens queues crashed in mergeBuf() with a TypeError. Push [data] instead, matching the upstream sonic-boom implementation.

Signed-off-by: Daijiro Wachi <daijiro.wachi@gmail.com>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/streams

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. stream Issues and PRs related to the stream subsystem. labels Jun 10, 2026

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcollina mcollina added the request-ci Add this label to start a Jenkins CI on a PR. label Jun 10, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 10, 2026
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@trivikr trivikr added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jun 15, 2026
@watilde watilde added the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 16, 2026
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 16, 2026
@nodejs-github-bot nodejs-github-bot merged commit 6e8c171 into nodejs:main Jun 16, 2026
84 of 86 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 6e8c171

aduh95 pushed a commit that referenced this pull request Jun 18, 2026
Signed-off-by: Daijiro Wachi <daijiro.wachi@gmail.com>
PR-URL: #63833
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Mattias Buelens <mattias@buelens.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. needs-ci PRs that need a full CI run. stream Issues and PRs related to the stream subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants