ReviewOS

home-lang/home

Bun parity: complete client fetch API semantics

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

Upstream coverage

  • js/web/fetch/client-fetch.test.ts (corpus position 4120)

Current gap

The first failing assertion reports function signature: Expected 2 to be 1, indicating that Home's fetch-compatible callable metadata does not yet match Bun's public API contract.

Required parity

  • match Bun's fetch.length and callable surface metadata
  • preserve existing request/response behavior while correcting the public signature
  • run the complete upstream file and resolve each remaining semantic mismatch logically
  • model any failures with stable structured Home error identities, causal context, and useful stacks
  • add a focused regression and pin the upstream file in the permanent web queue

Blocked by/completes the next ordered step after #347.

10 days ago

Implemented and pushed to main in c856f35 (fix(fetch): complete client request semantics).

What landed:

  • Bun-compatible fetch.name / fetch.length and invalid-input validation
  • structured ERR_FETCH_INPUT, ERR_FETCH_CONNECT, and ERR_FETCH_REDIRECT failures with operation context, causes, and composed stacks
  • Node HTTP server sync/async disposal for using / await using
  • byte-preserving request/response bridging, request data/end, req.pipe(res), and redirect body replay
  • HTTP response MIME normalization without altering byte-exact multipart boundary values
  • UTF-8 multipart field-name and filename decoding
  • structured ERR_FORM_DATA_PARSE closing-boundary failures
  • distinct locked vs disturbed body semantics through ERR_BODY_STREAM_STATE
  • Bun-compatible .resolves.pass() behavior for already-resolved explicit-pass assertions
  • focused and permanent-queue regressions

Verification:

  • exact corpus position 4120: 29 passed, 2 todo, 0 failed, 0 unsupported
  • dedicated client-fetch regression: passed
  • permanent HTTP/web tail queue: passed
  • clean-cache zig build --cache-dir /private/tmp/home-zig-abi-cache: passed

The ordered frontier now reaches through position 4120. Position 4121 is tracked separately.

Sign in to comment on this issue.