ReviewOS

home-lang/home

Bun parity: honor fetch keepalive and TLS pool identity

#357
Closed chris opened this 10 days ago ·
10 days ago

Corpus frontier position 4137 (js/web/fetch/fetch-keepalive.test.ts) exposes incorrect fetch connection semantics.

Scope:

  • omit the synthetic Connection header when keepalive: false
  • emit Connection: keep-alive when explicitly enabled without overriding a caller header
  • key reusable TLS connections by effective Host/SNI identity, so a different Host header cannot inherit an incompatible pooled socket
  • preserve structured connection/pool errors with operation, endpoint/identity, cause, and composed stack
  • add a permanent focused regression and advance the zero-failure Bun corpus frontier

First failure: keepalive: Expected value to be undefined (the bootstrap currently injects Connection: keep-alive unconditionally).

10 days ago

Completed and pushed in a974c63 (fix(fetch): honor keepalive pool identity).

Implemented:

  • keepalive: false no longer receives an injected Connection header and disables pool reuse
  • keepalive: true injects Connection: keep-alive only when the caller did not supply Connection
  • default fetch pooling remains enabled without exposing a synthetic header
  • TLS pool keys now include the effective Host authority and normalized TLS options, preventing incompatible Host/SNI reuse
  • a permanent focused regression executes the complete upstream file

Verification:

  • fetch-keepalive.test.ts: 2 passed, 0 failed/unsupported
  • focused keepalive/TLS identity regression: pass
  • full zig build: pass

Corpus frontier through position 4137: 478 files, 6,841 passed, 280 todo, 172 allowed-empty, 0 failed, 0 unsupported.

Sign in to comment on this issue.