Skip to content

websockets: track bufferedAmount for typed arrays in ArrayBuffer (v1.8.0 backport of #5716) - #5990

Merged
inancgumus merged 1 commit into
v1.xfrom
backport-5716-ws-bufferedamount-typedarray
May 15, 2026
Merged

websockets: track bufferedAmount for typed arrays in ArrayBuffer (v1.8.0 backport of #5716)#5990
inancgumus merged 1 commit into
v1.xfrom
backport-5716-ws-bufferedamount-typedarray

Conversation

@mstoykov

Copy link
Copy Markdown
Contributor

What?

Backport of #5716 to the v1.x release branch for v1.8.0.

Fixes a bug in the WebSocket implementation where bufferedAmount was not
being tracked when sending typed arrays backed by an ArrayBuffer. The
fix 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 bufferedAmount property 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

  • I have performed a self-review of my code.
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have added tests for my changes.
  • I have run linter and tests locally (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.

  • I have added the correct milestone and labels to the PR.
  • I have updated the release notes: link
  • I have updated or added an issue to the k6-documentation: grafana/k6-docs#NUMBER if applicable
  • I have updated or added an issue to the TypeScript definitions: grafana/k6-DefinitelyTyped#NUMBER if applicable

Related PR(s)/Issue(s)

websockets: buffered amount not tracked in ArrayBuffer for typed arrays - fixes #5715
@mstoykov
mstoykov requested a review from a team as a code owner May 15, 2026 09:20
@mstoykov mstoykov added this to the v1.8.0 milestone May 15, 2026
@mstoykov
mstoykov requested review from inancgumus and szkiba and removed request for a team May 15, 2026 09:20
@mstoykov
mstoykov temporarily deployed to azure-trusted-signing May 15, 2026 09:25 — with GitHub Actions Inactive
@mstoykov
mstoykov temporarily deployed to azure-trusted-signing May 15, 2026 09:27 — with GitHub Actions Inactive
@inancgumus
inancgumus merged commit 636c63f into v1.x May 15, 2026
55 of 57 checks passed
@inancgumus
inancgumus deleted the backport-5716-ws-bufferedamount-typedarray branch May 15, 2026 19:40
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.

3 participants