Skip to content

Keep bare addresses and host names out of error reports - #1939

Merged
BarganConstantin merged 1 commit into
developmentfrom
fix/error-hosts
Oct 4, 2026
Merged

BarganConstantin merged 1 commit into
developmentfrom
fix/error-hosts

Conversation

@BarganConstantin

Copy link
Copy Markdown
Owner

What changes

  • Error reports no longer carry an address with no scheme in front. The server's scrub and the page's both turn every IPv4 and IPv6 address, and a host name where a network error puts one (after getaddrinfo ENOTFOUND / EAI_AGAIN or connect 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:4317 is sent as connect ECONNREFUSED <host>:4317, getaddrinfo ENOTFOUND bobs-pc.local as getaddrinfo ENOTFOUND <host>, and fe80::1%en0, [fd7a:115c::5]:4317, a 100.x address and a *.ts.net name the same way.
  • The loopback and the any-address stay (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.
  • The page's copy uses the same two patterns as the server's, held together by the new test. README's reports section says what is scrubbed now.

Verification

  • npm run typecheck clean.
  • Full suite: 897 test files, 11760 tests passed.
  • New 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.ts pass.

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.
@BarganConstantin
BarganConstantin merged commit 5f69c06 into development Oct 4, 2026
10 checks passed
@BarganConstantin BarganConstantin mentioned this pull request Oct 5, 2026
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.

1 participant