Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net autoSelectFamily functions not available in 18.8.0 #50017

Closed
lukekarrys opened this issue Oct 2, 2023 · 2 comments
Closed

net autoSelectFamily functions not available in 18.8.0 #50017

lukekarrys opened this issue Oct 2, 2023 · 2 comments
Labels
net Issues and PRs related to the net subsystem.

Comments

@lukekarrys
Copy link
Member

lukekarrys commented Oct 2, 2023

Version

v18.8.0

Platform

Darwin pieholden-m1.local 22.6.0 Darwin Kernel Version 22.6.0: Fri Sep 15 13:41:30 PDT 2023; root:xnu-8796.141.3.700.8~1/RELEASE_ARM64_T8103 arm64 arm Darwin

Subsystem

net

What steps will reproduce the bug?

node -e 'console.log(process.version, typeof net.getDefaultAutoSelectFamily)'

Running the previous code in 18.8.0 shows that net.getDefaultAutoSelectFamily is undefined. Looking at the recent changelog, I believe this function (and the other related autoSelectFamily getters/setters) should be included in this release.

Here's the output from running the above code using both 18.8.0 and 20.8.0 on my machine:

❯ fnm use 18.8.0
Using Node v18.8.0
❯ node -e 'console.log(process.version, typeof net.getDefaultAutoSelectFamily)'
v18.8.0 undefined
❯ fnm use 20.8.0
Using Node v20.8.0
❯ node -e 'console.log(process.version, typeof net.getDefaultAutoSelectFamily)'
v20.8.0 function

How often does it reproduce? Is there a required condition?

This reproduces every time for me.

What is the expected behavior? Why is that the expected behavior?

net.getDefaultAutoSelectFamily and net.setDefaultAutoSelectFamily should both be functions. This is expected because #45777 is indicated as having been backported to v18.

What do you see instead?

net.getDefaultAutoSelectFamily and net.setDefaultAutoSelectFamily are undefined.

Additional information

The functions are listed in the docs (https://nodejs.org/docs/latest-v18.x/api/net.html#netgetdefaultautoselectfamily) but with Added in: v19.4.0. This might be related.

@lukekarrys lukekarrys added the net Issues and PRs related to the net subsystem. label Oct 2, 2023
@richardlau
Copy link
Member

It was backported to Node.js 18.18.0:

$ nvm run 18.18.0 -e 'console.log(process.version, typeof net.getDefaultAutoSelectFamily)'
Running node v18.18.0 (npm v9.8.1)
v18.18.0 function
$

(tested on Linux x64)

The functions are listed in the docs (https://nodejs.org/docs/latest-v18.x/api/net.html#netgetdefaultautoselectfamily) but with Added in: v19.4.0. This might be related.

That looks like an oversight when the functionality was backported and should be corrected on v18.x-staging.

@lukekarrys
Copy link
Member Author

Thanks @richardlau, I definitely mistyped those when expecting to get the latest version of v18. I might've got mixed up when typing v20.8.0 and v18.18.0 too much 🤦🏼 . Glad this is not an issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
net Issues and PRs related to the net subsystem.
Projects
None yet
Development

No branches or pull requests

2 participants