Repository navigation
test-dns-ipv6.js is broken #47726
Description
Activity
- addeddnsIssues and PRs related to the dns subsystem.Issues and PRs related to the dns subsystem.testIssues and PRs related to Node.js core tests and test infrastructure.Issues and PRs related to Node.js core tests and test infrastructure.
on Apr 26, 2023 I'm looking into it.
- addedconfirmed-bugIssues and PRs for confirmed bugs.Issues and PRs for confirmed bugs.
on Apr 26, 2023 It works with Node 18 (Ada v1.0.4)
> node -v v18.16.0 > node test/internet/test-dns-ipv6.js test_resolve6 test_reverse_ipv6 test_lookup_ipv6_explicit test_lookup_ipv6_explicit_object test_lookup_ipv6_hint test_lookup_ip_ipv6 test_lookup_all_ipv6 test_lookupservice_ip_ipv6lib/internal/dns/promises.jsline 277 callstoASCIIwhich is:const err = resolver._handle[bindingName](req, toASCII(hostname));
I found the bug:
2001:4860:4860::8888passed todomainToASCIIpreviously returned the same payload, but withada::idna,it returns an empty string (detecting invalid). cc @lemire@tniessen the following diff fixes the issue, although, we need to fix this and release a new version of Ada...
diff --git a/lib/internal/idna.js b/lib/internal/idna.js index 566f8590d8..8591226d10 100644 --- a/lib/internal/idna.js +++ b/lib/internal/idna.js @@ -1,4 +1,9 @@ 'use strict'; -const { domainToASCII, domainToUnicode } = require('internal/url'); -module.exports = { toASCII: domainToASCII, toUnicode: domainToUnicode }; +if (internalBinding('config').hasIntl) { + const { toASCII, toUnicode } = internalBinding('icu'); + module.exports = { toASCII, toUnicode }; +} else { + const { domainToASCII, domainToUnicode } = require('internal/url'); + module.exports = { toASCII: domainToASCII, toUnicode: domainToUnicode }; +}
- addedurlIssues and PRs related to the legacy built-in url module.Issues and PRs related to the legacy built-in url module.whatwg-urlIssues and PRs related to the WHATWG URL implementation.Issues and PRs related to the WHATWG URL implementation.
on Apr 26, 2023 So pretty much reverting ead4079, or at least the
lib/changes of that? I assume it's still going to fail if!hasIntl. Then again, I don't think we care about non-ICU builds.I think the
idna.jsis flawed.icu.toASCIIdoes not equal todomainToASCII. I think our approach is correct, but the previous code was flawed, and our pull request on removing the ICU fromidna.jsexposed the bug.Reacted by Gürgün DayıoğluNo need to revert, I'll add a new C++ function that directly calls
ada::idna::to_asciiand expose them through internalBinding.
Both in GitHub actions and locally, for the last three weeks as far as I can tell: