chore: use Promise.withResolvers in SOCKS5 proxy agent#4978
Merged
mcollina merged 3 commits intonodejs:mainfrom Apr 6, 2026
Merged
chore: use Promise.withResolvers in SOCKS5 proxy agent#4978mcollina merged 3 commits intonodejs:mainfrom
mcollina merged 3 commits intonodejs:mainfrom
Conversation
- Replace manual promise wrappers across API and dispatcher paths - Keep error and timeout handling intact while simplifying control flow Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
mcollina
requested changes
Apr 5, 2026
Member
mcollina
left a comment
There was a problem hiding this comment.
Most of those are not useful in making the code more readable and they add more overhead (destructuring costs) but the socks5 changes are ok
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4978 +/- ##
=======================================
Coverage 92.94% 92.94%
=======================================
Files 110 110
Lines 35767 35773 +6
=======================================
+ Hits 33244 33251 +7
+ Misses 2523 2522 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
This relates to...
Follow-up to #4972 which replaced
createDeferredPromisewith Promise.withResolvers()Rationale
This PR narrows a broader
Promise.withResolvers()refactor down to the places where it is most useful in the SOCKS5 proxy flow.The initial change applied the pattern across several async helpers, but the follow-up commits intentionally restored the simpler
new Promise(...)form in lower-value cases to avoid overhead. The resulting PR focuses on the SOCKS5 proxy agent, where separating promise creation from event wiring makes the connection/authentication/TLS flow easier to follow.Changes
Promise.withResolvers()Promise.withResolvers()Promise.withResolvers()Promise.withResolvers()Features
N/A
Bug Fixes
N/A
Breaking Changes and Deprecations
N/A
Status