inspector: capture HTTP body before decoding - #64496
Closed
Archkon wants to merge 1 commit into
Closed
Conversation
Collaborator
|
Review requested:
|
This comment was marked as spam.
This comment was marked as spam.
Codecov Reportβ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #64496 +/- ##
==========================================
- Coverage 90.32% 90.31% -0.02%
==========================================
Files 759 760 +1
Lines 248326 248537 +211
Branches 46859 46903 +44
==========================================
+ Hits 224293 224458 +165
- Misses 15481 15506 +25
- Partials 8552 8573 +21
π New features to boost your workflow:
|
This comment was marked as spam.
This comment was marked as spam.
legendecas
reviewed
Jul 20, 2026
legendecas
left a comment
Member
There was a problem hiding this comment.
I'm not a fan of an ad-hoc symbol method for this. What about adding a diagnostic channel dedicated for http body chunks?
Also I'd like to hear from @nodejs/http about any suggestions on this?
This comment was marked as spam.
This comment was marked as spam.
igochkov
added a commit
to igochkov/vscode-regelspraak
that referenced
this pull request
Aug 9, 2026
* Run CI on Node 24 and the current action majors
Same move as the server repository, for the same reasons: the runner was
forcing actions/checkout@v4 and actions/setup-node@v4 onto Node 24 and
warning about it, and Node 20 went end-of-life in April 2026 while the
extension host this client runs in is on 24.
* Turn off the debugger's network view for F5
Opening any .rgs file in the Extension Development Host logged a
TypeError from deep inside Node, with no frame belonging to this
extension:
TypeError: Missing dataLength in event
at broadcastToFrontend (node:inspector:212:3)
at Object.dataReceived (node:inspector:221:29)
at IncomingMessage.<anonymous> (node:internal/inspector/network_http:140:13)
It is nodejs/node#64494. VS Code starts every extension host with
--experimental-network-inspection, and js-debug enables the Network
domain for the session because debug.javascript.enableNetworkView
defaults to true. Node's instrumentation then reads chunk.byteLength on
each response chunk β which is undefined once anything calls
res.setEncoding(), because string chunks have length, not byteLength β
and the runtime rejects the event.
The throw is not cosmetic: it runs in a listener registered ahead of the
consumer's own, so the offending request's body is swallowed. Nothing
here makes HTTP requests (the client talks to the server over IPC), so
this only ever hits some other extension loaded into the development
host, but it is noise on every debug session.
A fix is pending upstream in nodejs/node#64496; drop this setting once
the runtime carries it.
* Type against Node 24 as well as build on it
Matches the server repository: bumping only the runtime left the type
surface a major behind the extension host we ship into.
@types/node 24 pulls in esnext.disposable, which puts [Symbol.dispose]
on MapIterator. vscode-jsonrpc's LinkedMap β reached here through
vscode-languageclient β extends Map but declares keys()/values()/
entries() as IterableIterator, so the library's own .d.ts no longer
type-checks (TS2416). vscode-jsonrpc 9.0.1, the newest, declares it the
same way, so upgrading is not a way out; skipLibCheck is.
A forced full rebuild and lint are both clean.
This comment was marked as spam.
This comment was marked as spam.
Capture HTTP response body chunks before stream decoding so network inspection receives the original bytes when user code calls response.setEncoding(). Signed-off-by: Archkon <180910180+Archkon@users.noreply.github.com>
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.
Fixes: #64494