ReviewOS

home-lang/home

Bun parity: enforce fetch stream lock lifecycles

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

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

Scope:

  • enforce exclusive ReadableStream.getReader() locking while response body consumption is active
  • reject already-locked request body streams with Bun-compatible ERR_STREAM_CANNOT_PIPE
  • preserve structured lifecycle errors, causes, operation/phase metadata, and composed stacks
  • port and pass the complete upstream streaming matrix without weakening assertions

Parent tracker: #66

10 days ago

Completed in 965ffd9 and pushed to main.

Implemented the full copied js/web/fetch/fetch.stream.test.ts contract:

  • exclusive response-body reader locks and Bun-compatible ERR_STREAM_CANNOT_PIPE request rejection
  • callback-style node:stream.pipeline() and direct-stream prototype composition
  • live response inspection byte counts
  • lazy gzip/deflate/Brotli/Zstd decoding for stream readers
  • header-first async pull priming with demand-driven continuation
  • partial Content-Length delivery with TimeoutError/ECONNRESET termination
  • raw chunked subprocess fixture lifecycle
  • structured operation/phase/cause metadata and composed stacks throughout

Verification:

  • exact corpus position 4149: 110 passed, 5 todo, 0 failed, 0 unsupported
  • permanent focused regression: pass
  • zig build --cache-dir /private/tmp/home-zig-abi-cache: pass

Parent tracker: #66

Sign in to comment on this issue.