Skip to content

Conversation

@kapouer
Copy link
Contributor

@kapouer kapouer commented Sep 23, 2025

This fixes #59803

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels Sep 23, 2025
@kapouer
Copy link
Contributor Author

kapouer commented Sep 23, 2025

However I see that https://github.com/nodejs/node/actions/runs/17947125836/job/51036256456
there is already a job that tests this situation, and this PR broke it.

So it's weird that it did fail previously.
I can't believe this is only because I chose the path to contain a tilde and not any other character ?!?

@codecov
Copy link

codecov bot commented Sep 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.44%. Comparing base (24ded11) to head (9b67c1f).
⚠️ Report is 275 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #59991      +/-   ##
==========================================
- Coverage   88.45%   88.44%   -0.02%     
==========================================
  Files         703      703              
  Lines      207544   207544              
  Branches    40013    40016       +3     
==========================================
- Hits       183587   183563      -24     
+ Misses      15965    15955      -10     
- Partials     7992     8026      +34     

see 45 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.

session.post('Debugger.setBreakpointByUrl', {
'lineNumber': 22,
'url': pathToFileURL(path.resolve(__dirname, __filename)).toString(),
'url': decodeURIComponent(pathToFileURL(path.resolve(__dirname, __filename)).toString()),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is correct. The field url has to be a string in correct URL format.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree - I totally failed to fix this. I spent hours on this trying to find the root cause, no success.
My plan is to ignore that bug :(

Copy link
Member

@cola119 cola119 Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@legendecas It seems that the inspector server can't resolve the file and fails to set breakpoints when the url has encoded values. Decoding the url by the client looks a valid workaround to me. What do you think?

Decoded URL

[inspector received] {"id":3,"method":"Debugger.setBreakpointByUrl","params":{"lineNumber":18,"url":"file:///Users/kohei/Documents/node/test/parallel/test-inspector-connect-main-thread~.js","columnNumber":0,"condition":""}}
[inspector send] {"id":3,"result":{"breakpointId":"1:18:0:file:///Users/kohei/Documents/node/test/parallel/test-inspector-connect-main-thread~.js","locations":[{"scriptId":"76","lineNumber":18,"columnNumber":8}]}}

Encoded URL

[inspector received] {"id":3,"method":"Debugger.setBreakpointByUrl","params":{"lineNumber":18,"url":"file:///Users/kohei/Documents/node/test/parallel/test-inspector-connect-main-thread%7E.js","columnNumber":0,"condition":""}}
[inspector send] {"id":3,"result":{"breakpointId":"1:18:0:file:///Users/kohei/Documents/node/test/parallel/test-inspector-connect-main-thread%7E.js","locations":[]}}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that there is already logic implemented to percent-encode special characters.
It's even tested by one of node's CI.
However, it fails for ~ (and + maybe), and this PR means nothing until it understands why.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that there is already logic implemented to percent-encode special characters.

Can you point it out?

Copy link
Contributor Author

@kapouer kapouer Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No ! I only know there is a test about it, and that test doesn't include ~ + chars

- name: Re-run test in a folder whose name contains unusual chars
run: |
mv node "$DIR"
cd "$DIR"
./tools/test.py --flaky-tests keep_retrying -p actions -j 4
env:
DIR: dir%20with $unusual"chars?'åß∂ƒ©∆¬…`

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's an interesting point. The filename including ? can work fine.

[inspector received] {"id":3,"method":"Debugger.setBreakpointByUrl","params":{"lineNumber":18,"url":"file:///Users/kohei/Documents/node/test/parallel/test-inspector-connect-main-thread%3F.js","columnNumber":0,"condition":""}}
[inspector send] {"id":3,"result":{"breakpointId":"1:18:0:file:///Users/kohei/Documents/node/test/parallel/test-inspector-connect-main-thread%3F.js","locations":[{"scriptId":"76","lineNumber":18,"columnNumber":8}]}}

@cola119 cola119 added the inspector Issues and PRs related to the V8 inspector protocol label Oct 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inspector Issues and PRs related to the V8 inspector protocol needs-ci PRs that need a full CI run. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inspector tests fail when current path has encoded characters (like ~)

4 participants