ReviewOS

home-lang/home

Bun parity: parse split chunked bodies and trailing headers

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

Upstream coverage

  • js/web/fetch/chunked-trailing.test.js (corpus position 4119)

Current gap

The synthetic fetch transport returns an empty body when chunked response data and trailing headers are split across packets. The first assertion expects Hello, world.

Required parity

  • parse chunk sizes and payloads across packet boundaries
  • preserve trailing headers without including them in body bytes
  • model premature EOF and malformed chunk framing with structured transport errors and causal stacks
  • add a focused regression and pin the upstream file in the permanent web queue
10 days ago

Implemented and pushed to main in c5d46c3 (fix(fetch): parse chunked response trailers).

What landed:

  • incremental HTTP/1 response readiness instead of resolving at the header terminator
  • chunk-size, chunk-extension, payload, CRLF, zero-chunk, and trailer parsing across packet boundaries
  • response completion at the zero chunk without waiting for delayed trailers
  • Bun-compatible ECONNRESET / InvalidHTTPResponse transport codes
  • richer Home diagnostics through ERR_FETCH_RESPONSE_FRAMING, operation, phase, receivedBytes, causal errors, and composed stacks
  • a focused 23-test regression and a permanent HTTP/web queue entry

Verification:

  • exact corpus position 4119: 23 passed, 0 failed, 0 todo, 0 unsupported
  • dedicated chunked/trailer regression: passed
  • permanent HTTP/web tail queue: passed
  • zig build --cache-dir /private/tmp/home-zig-abi-cache: passed

The ordered frontier now reaches through position 4119. The next independent gap is tracked separately.

Sign in to comment on this issue.