Skip to content

chore: guard client[kUrl] in closeClientIfUnused loop#5532

Open
vctqs1 wants to merge 3 commits into
nodejs:mainfrom
vctqs1:patch-1
Open

chore: guard client[kUrl] in closeClientIfUnused loop#5532
vctqs1 wants to merge 3 commits into
nodejs:mainfrom
vctqs1:patch-1

Conversation

@vctqs1

@vctqs1 vctqs1 commented Jul 9, 2026

Copy link
Copy Markdown

This relates to...

When a custom factory (e.g ProxyAgent) is used with Agent the dispatcher registered in kClients may not have kUrl set.
ProxyAgent extends DispatcherBase directly and never assigns this[kUrl] so client[kUrl] is undefined for every proxied origin key

Screenshot 2026-07-09 at 08 30 08 Used Error.prepareStackTrace to surface the stack trace here . it was being suppressed because the frames originate from node:internal.

Testing

Screenshot 2026-07-14 at 11 55 31

Rationale

Changes

Features

Bug Fixes

Breaking Changes and Deprecations

Status

@vctqs1 vctqs1 changed the title chore: add null check for client URL in origin comparison chore: guard client[kUrl] in closeClientIfUnused loop Jul 9, 2026
@vctqs1 vctqs1 marked this pull request as ready for review July 9, 2026 01:32

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for opening a PR! Can you please add a unit test?

@codecov-commenter

codecov-commenter commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.44%. Comparing base (3c662a5) to head (d0504a7).
⚠️ Report is 19 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #5532    +/-   ##
========================================
  Coverage   93.44%   93.44%            
========================================
  Files         110      110            
  Lines       37329    37434   +105     
========================================
+ Hits        34883    34982    +99     
- Misses       2446     2452     +6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 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.

@vctqs1

vctqs1 commented Jul 14, 2026

Copy link
Copy Markdown
Author

@mcollina yeah sure, i'll add unit-test for it

@vctqs1

vctqs1 commented Jul 14, 2026

Copy link
Copy Markdown
Author

I updated it @mcollina could you please help review again, Thanks

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.

4 participants