ReviewOS

home-lang/home

Port Bun.file and multipart fetch upload integration

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

Track the exact upstream test/js/bun/http/fetch-file-upload.test.ts corpus in Home.

Scope:

  • activate the byte-identical six-test corpus instead of a whole-file TODO
  • infer Bun.file .txt responses as text/plain;charset=utf-8
  • round-trip Bun.file and multipart FormData request/response bodies
  • mark public request-body readers consumed without breaking internal Request.clone teeing
  • route async and synchronous Bun.serve fetch failures through the configured error handler
  • stream compact large logical buffers through fs.writeFileSync, Bun.file, and CryptoHasher for the 128 MiB sendfile case
  • reject missing Bun.file request bodies immediately and expose the rejected state through Bun.peek
  • add durable exact-corpus regression coverage
  • pass the exact corpus, related body-clone corpus, and full home_test gate

Parent: #66

10 days ago

Completed and pushed in 7b2cf0d4eeb1df2dc478e9c89e7f9ab101a78156.

Validation:

  • exact upstream corpus SHA-256: 3134d87db0ce21c863d128bc8b1c07aa38ffedeb3683ef11d4541bfa8c0b97b5 (byte-identical to ~/Code/bun/test/js/bun/http/fetch-file-upload.test.ts)
  • exact upload corpus: 1 file, 6 passed, 0 failed, 0 unsupported, 0 TODO
  • related body-clone corpus: 1 file, 25 passed, 0 failed, 0 unsupported, 0 TODO
  • full gate: ./pantry/.bin/zig build test -Dfilter=home_test --summary failures exited 0

Implemented shared .txt MIME inference, Bun.file and multipart round-trips, public body-reader consumption with internal clone suppression, direct Bun.serve error-handler routing for sync/async fetch failures, compact 128 MiB logical-buffer file streaming and hash parity, synchronous missing-file rejection with Bun.peek state, and durable exact-corpus coverage.

Sign in to comment on this issue.