Files
oh-my-pi/packages
roboomp 7d6a5c6de0 fix(utils): normalized ptree.bytes() return type to Uint8Array
Bun's `Response(stream).bytes()` returns the raw `ArrayBuffer` once the
body arrives in more than one chunk, which happens for subprocess stdout
past ~128 KB. The public contract of `ptree.ChildProcess.bytes()` is
`Promise<Uint8Array>`, and callers — most visibly the `ssh://` read
path's `decodeUtf8Text` — rely on `Uint8Array` methods such as `.indexOf`
and `.subarray`. On larger remote text files this surfaced as:

  TypeError: bytes.indexOf is not a function

Normalize the result at the boundary: when `Response.bytes()` hands back
an `ArrayBuffer`, wrap it in a zero-copy `Uint8Array` view before
returning. Adds a regression test that drives a 256 KB stdout payload
through `ptree.spawn(...).bytes()` and asserts the contract.

Fixes #3712
2026-06-28 10:04:53 +00:00
..
2026-06-27 04:39:59 +02:00
2026-06-27 13:24:46 +02:00
2026-06-27 13:24:46 +02:00
2026-06-27 13:24:46 +02:00
2026-06-27 13:24:46 +02:00
2026-06-27 13:24:46 +02:00
2026-06-27 13:24:46 +02:00