ReviewOS

home-lang/home

Bun parity: port core fetch and Request matrix

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

Tracks copied Bun corpus position 4150 (js/web/fetch/fetch.test.ts).

Scope:

  • validate and normalize Request URLs with structured parse diagnostics
  • port data URLs, AbortSignal behavior, request/response streaming, Unix/TLS/network options, and remaining fetch lifecycle cases
  • preserve Bun-visible errors while adding operation/phase/cause metadata and composed stacks
  • pass the complete upstream file without weakening assertions

Parent tracker: #66

10 days ago

Completed in 9eb0b8630 and pushed to main.

The complete copied js/web/fetch/fetch.test.ts matrix now passes unchanged: 350 passed / 0 failed / 0 todo / 0 unsupported.

Implemented parity includes:

  • normalized Request URLs, signals, default headers, body lengths, Response helpers, file/data URLs, and FIFO/file permission behavior
  • AbortSignal upload cancellation, timeout reasons, and deterministic server-request signal propagation
  • informational HTTP/1 response handling with incremental buffer release
  • redirect method/header/origin semantics, maxRedirects, raw-net redirect following, and structured duplex redirect rejection
  • Node Readable and async-iterator duplex request bodies
  • strict Content-Length framing, TE/CL request sanitization, and guarded keep-alive reuse that rejects surplus response bytes
  • response lifecycle subprocess/IPC coverage and improved Error formatting with code/operation/phase/cause context

Verification:

  • permanent full-file regression: green at 350 cases
  • upstream mirror: byte-for-byte unchanged
  • zig fmt and git diff --check: clean
  • zig build --cache-dir /private/tmp/home-zig-abi-cache: green

Parent tracker: #66

Sign in to comment on this issue.