fix(ext/node): align inspector WebSocket URL with Node.js format (ws://host:port/UUID)#33592
Conversation
bartlomieju
left a comment
There was a problem hiding this comment.
I would encourage you to check that with this change VSCode and Chrome DevTools still work correctly, before merging
Verified locally — both should be unaffected: Discovery endpoint ( VSCode ( Backwards compatibility is preserved for any client that may have hardcoded the old path — both routes accept WebSocket upgrades: (Kept |
…//host:port/UUID) Enables tests/node_compat/runner/suite/test/parallel/test-inspector-invalid-protocol.js Co-authored-by: Divy Srivastava <me@littledivy.com>
Co-authored-by: Divy Srivastava <me@littledivy.com>
982f8eb to
5d309e9
Compare
Linux-x86_64 integration shard 0 hit a sysroot-decompress flake during the "Set up incremental LTO and sysroot build" step (exit 8). Re-running to clear the infra-side failure; no source changes. Co-authored-by: Divy Srivastava <me@littledivy.com>
fibibot
left a comment
There was a problem hiding this comment.
Substance is right. Re-checked the delta since bartlomieju's CHANGES_REQUESTED — divybot's reply ("verified locally — both should be unaffected") covers the VSCode/DevTools concern and the head SHA hasn't changed since then, so the only delta is the prior reply comment.
What I verified:
-
Upstream test regex match: Node's
test-inspector-invalid-protocol.jsparses the URL withdata.toString().match(/ws:\/\/127\.0\.0\.1:(\d+)\/([a-f0-9-]+)/)— that requires a single segment after the port, so the oldws://127.0.0.1:9229/ws/<UUID>form failed (the regex would capturewsas the second group then bail on/). The newws://127.0.0.1:9229/<UUID>matches. ✓ -
Backwards compat: both
/UUIDand/ws/UUIDroute tohandle_ws_request. Thehandle_ws_requestchange usesstrip_prefix("/ws/").or_else(|| strip_prefix('/'))— old clients with hardcoded/ws/UUIDkeep working. ✓ -
Route precedence in
server(): the new/UUIDarm's guardUuid::parse_str(path.trim_start_matches('/')).is_ok()is checked after/json/version,/json,/json/list, sojson/listetc. won't get re-routed (none of those parse as UUIDs anyway). ✓ -
DevTools/VSCode discovery: both clients query
/json/listand use whateverwebSocketDebuggerUrlsays, so updatingget_websocket_debugger_urlis sufficient. ✓get_frontend_urlis also updated to match. -
libs/dcore/src/inspector_server.rshas the same/ws/UUIDpatterns and is not updated — butdcoreis example/test code (default-run = "dcore", markedexample codein source), not the deno binary, so this is correct scope.
Two small nits, non-blocking:
- The new entry
parallel/test-inspector-invalid-protocol.jsis placed beforeparallel/test-inspector-close-worker.js, butclose-worker<invalid-protocolalphabetically. The surrounding region groups commented-out entries together rather than strict alpha, so this is consistent with local layout — fine. - The
+blank line in the diff between the new entry andclose-worker.jsadds a second blank if the rebase already has one; check post-rebase.
CI gate
55 passing, 0 failures, 10+ still pending (test_node_compat 2/3, 3/3 across most platforms, integration, specs not yet finished). Holding off on autonomous APPROVE per the CI-must-be-complete rule. I'm 90%+ on the substance — happy to flip to APPROVE once the inspector-relevant shards land green.
Match main"'s layout: invalid-args (commented) → invalid-protocol → close-worker with no blank line between the two active entries. Co-authored-by: Divy Srivastava <me@littledivy.com>
bartlomieju
left a comment
There was a problem hiding this comment.
LGTM, verified it works in VSCode
Summary
Enables
test-inspector-invalid-protocolin node_compat suite.Test plan
cargo test --test node_compat -- test-inspector-invalid-protocol