Skip to content

inspector: handle string chunks in network http - #66552

Open
lazerg wants to merge 1 commit into
nodejs:mainfrom
lazerg:fix/issue-66551-inspector-string-chunks
Open

lazerg wants to merge 1 commit into
nodejs:mainfrom
lazerg:fix/issue-66551-inspector-string-chunks

Conversation

@lazerg

@lazerg lazerg commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

When a client response has setEncoding() set, the data listener that network inspection adds gets strings instead of Buffers. chunk.byteLength is then undefined, so Network.dataReceived throws "Missing dataLength in event" and the request fails. This turns string chunks back into a Buffer using the stream's encoding before reporting them. The http2 client had the same listener and the same problem, so it gets the same fix.

Fixes: #66551

Signed-off-by: lazerg <lazerg2@gmail.com>
Assisted-by: Claude Code
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/inspector

@nodejs-github-bot nodejs-github-bot added http2 Issues and PRs related to the http2 subsystem. inspector Issues and PRs related to the V8 inspector protocol. needs-ci PRs that need a full CI run. labels Oct 6, 2026
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Caution

AgentScan found account activity patterns that may be consistent with automation. This is a heuristic, not proof that this pull request was opened by an agent or violates policy. AI-assisted contributions are permitted, but automated tooling must not open pull requests without advance approval, and contributors must personally understand, test, verify, and take responsibility for every submitted change. See the AgentScan analysis, AI use policy, and automation policy for additional context.

@codecov

codecov Bot commented Oct 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.41%. Comparing base (fcfb7ec) to head (1eb2ff9).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #66552   +/-   ##
=======================================
  Coverage   90.40%   90.41%           
=======================================
  Files         791      791           
  Lines      276226   276233    +7     
  Branches    53045    53046    +1     
=======================================
+ Hits       249732   249761   +29     
+ Misses      16899    16864   -35     
- Partials     9595     9608   +13     
Files with missing lines Coverage Δ
lib/internal/inspector/network_http.js 95.80% <100.00%> (+0.10%) ⬆️
lib/internal/inspector/network_http2.js 87.92% <100.00%> (+0.13%) ⬆️

... and 36 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

agentscan:community-flagged http2 Issues and PRs related to the http2 subsystem. inspector Issues and PRs related to the V8 inspector protocol. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

node:internal/inspector/network_http: TypeError: Missing dataLength in event when response uses setEncoding()

2 participants