ReviewOS

home-lang/home

Bun parity: keep Bun.file-backed Blob parts lazy

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

Upstream gap

Copied corpus position 4112 (js/web/fetch/blob.test.ts) now reaches Bun issue #12894. new File([Bun.file("foo.txt")], "bar.txt") eagerly reads the missing source and throws, although constructing the wrapper must remain lazy.

Required parity

  • Represent Bun.file-backed Blob/File parts as lazy segmented byte ranges.
  • Do not perform source-file I/O during Blob/File construction.
  • Preserve size, slicing, concatenation order, arbitrary bytes, and content type.
  • Materialize only on bytes/text/stream/body consumption and retain structured path/range/cause stacks for failures.
  • Add focused regression coverage and pass the full upstream file and queue.

Tracked under #66; exposed after #339, #340, and #341.

10 days ago

Completed in add6ef2.\n\nBlob construction now retains Bun.file parts as lazy segmented file references, including nested and sliced Blobs, instead of eagerly reading them. Missing zero-size files can be wrapped without I/O, and later read failures retain structured file-slice causes/stacks.\n\nVerified by the focused Bun.file-backed Blob regression and the permanent Blob corpus queue.

Sign in to comment on this issue.