ReviewOS

home-lang/home

Bun parity: stream sliced Blob response bodies as byte chunks

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

Upstream gap

Copied corpus position 4112 (js/web/fetch/blob.test.ts) now reaches Response(slice).body reader. The Response body stream emits the Blob object itself, so Buffer.concat(chunks) throws instead of receiving the selected bytes.

Required parity

  • Adopt a Blob body’s own stream in Response/Request body normalization.
  • Emit Uint8Array chunks, preserve slice bounds and content length, and leave the source slice reusable.
  • Propagate file-backed/sparse Blob stream errors with their structured cause chains.
  • Cover direct readers, Response text, and HTTP serving of sliced bodies.
  • Pass the complete upstream file and surrounding queue.

Tracked under #66; exposed after #339-#343.

10 days ago

Completed in add6ef2.\n\nResponse and Request now adopt actual Home Blob streams while retaining the original Blob for body consumers. Sliced Blob response bodies yield Uint8Array chunks with exact range bytes and content length, without consuming the source Blob. Oversized sparse bodies remain lazy and preserve ERR_BLOB_ALLOCATION diagnostics.\n\nVerified by the focused sliced response-stream regression, blob-oom (16 passing), and the permanent HTTP/web queue.

Sign in to comment on this issue.