Keep bare addresses and host names out of error reports - #1939
Merged
Merged
Conversation
The scrub took the host out of every web address but left an address with no scheme in front, so a network error still named the machine it failed on: connect ECONNREFUSED 192.168.1.5:4317, getaddrinfo ENOTFOUND bobs-pc.local, an IPv6 address with its zone, a Tailscale address or ts.net name. Both the server's scrub and the page's now make every IPv4 and IPv6 address, and a host name after a DNS or connect failure, glued to a port, or ending in .local, .lan, .home, .internal or .ts.net, <host>, with a separate port kept. The loopback and any-address stay, so a local port error reads as it is, and version numbers and file:line:col frames are left alone.
Draft
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.
What changes
getaddrinfo ENOTFOUND/EAI_AGAINorconnect E…, glued to a port, or ending in.local,.lan,.home,.internal,.ts.net), into<host>, with a separate port kept:connect ECONNREFUSED 192.168.1.5:4317is sent asconnect ECONNREFUSED <host>:4317,getaddrinfo ENOTFOUND bobs-pc.localasgetaddrinfo ENOTFOUND <host>, andfe80::1%en0,[fd7a:115c::5]:4317, a100.xaddress and a*.ts.netname the same way.127.0.0.1,::1,localhost,0.0.0.0,::), so a local port error still says which port. Version numbers (3.36.9,node-22.18.0) and file:line:col frames are left alone.Verification
npm run typecheckclean.src/web/__tests__/error-report-addresses.test.ts: the same table of bare addresses and names through both scrubs, a list that must come through untouched (loopback, any-address, versions, frames, already-scrubbed text), the two copies' patterns compared, and an error sent through the reporter with a stubbed fetch. It failed before the change (29 of its tests: every address and name was sent as it was) and passes after.error-report-paths.test.ts,error-report-origins.test.ts,dead-css.test.ts,reports-1853.test.ts,visible-feedback-1853.test.tspass.