websockets: track bufferedAmount for typed arrays in ArrayBuffer (v1.8.0 backport of #5716) - #5990
Merged
Merged
Conversation
websockets: buffered amount not tracked in ArrayBuffer for typed arrays - fixes #5715
mstoykov
requested review from
inancgumus and
szkiba
and removed request for
a team
May 15, 2026 09:20
mstoykov
temporarily deployed
to
azure-trusted-signing
May 15, 2026 09:25 — with
GitHub Actions
Inactive
mstoykov
temporarily deployed
to
azure-trusted-signing
May 15, 2026 09:27 — with
GitHub Actions
Inactive
szkiba
approved these changes
May 15, 2026
inancgumus
approved these changes
May 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Backport of #5716 to the v1.x release branch for v1.8.0.
Fixes a bug in the WebSocket implementation where
bufferedAmountwas notbeing tracked when sending typed arrays backed by an
ArrayBuffer. Thefix correctly accounts for the byte length of these payloads, and a test
is added to cover the case.
Credit to external contributor @prakharbirla-ng for the original change.
Why?
The
bufferedAmountproperty is part of the WebSocket API contract;users relying on it to backpressure-manage large binary sends would have
observed an incorrect (zero) value when sending typed arrays. Backporting
this small, well-scoped fix into v1.8.0 keeps the v1.x line consistent
with master without pulling in unrelated changes.
Checklist
make check) and all pass.Checklist: Documentation (only for k6 maintainers and if relevant)
Please do not merge this PR until the following items are filled out.
Related PR(s)/Issue(s)