Skip to content

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

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

chore: guard client[kUrl] in closeClientIfUnused loop#5532
vctqs1 wants to merge 2 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.

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

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 (cc78087).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5532      +/-   ##
==========================================
- Coverage   93.44%   93.44%   -0.01%     
==========================================
  Files         110      110              
  Lines       37329    37329              
==========================================
- Hits        34883    34881       -2     
- Misses       2446     2448       +2     

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

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.

3 participants