dragonflight/services
opencode a86c1c72f9 fix(player): stitch S3 ranges around RustFS empty-body bug (#143)
RustFS returns empty bodies for ranged GETs whose start offset is past
~5.9 MB on single-file proxy MP4s. HEAD reports correct size, full GET
(`bytes=0-`) works, but `bytes=8179166-` comes back 206 + correct
Content-Range header with zero bytes. Confirmed via direct S3 probe
against broadcastmgmt.cloud/dragonmam (see scratch tests).

Workaround in mam-api `GET /api/v1/assets/:id/video` until the proxy
worker emits HLS (planned v1.2.1):

  - HEAD the object first to learn total size (also gives ETag /
    Last-Modified for conditional requests).
  - No-Range / unparseable-Range / pre-EOF requests \u2192 plain pipe.
  - Parsed `bytes=N-M` requests below RUSTFS_RANGE_SAFE_START
    (default 5_500_000) \u2192 direct ranged GET, RustFS handles fine.
  - Anything reaching into the broken zone \u2192 stream from offset 0,
    drop bytes below start, stop at end. Memory stays flat; extra
    bandwidth = (end+1 - requested-size) per seek.
  - Genuinely out-of-range \u2192 416 with Cache-Control: no-store so the
    browser doesn't poison its cache.

Also stashes (not yet wired up) the HLS pieces we'll need for the
follow-up: `segmentToHls` ffmpeg helper + `uploadDirectoryToS3`
worker s3 helper. Harmless additions; not referenced by any code path
yet.

Confirmed against the affected asset (a72aaa03-...): bytes=0-100k +
50% +100k native pass-through; 70% +100k and near-EOF previously hung
the browser, now stream correctly via the stitched path.

Refs #143.
2026-05-27 02:38:42 +00:00
..
capture fix(recorders,library): empty-capture handling + right-click context menu 2026-05-23 03:52:30 +00:00
mam-api fix(player): stitch S3 ranges around RustFS empty-body bug (#143) 2026-05-27 02:38:42 +00:00
node-agent chore: 1.2 ship-prep sweep — close 38 issues 2026-05-27 02:06:14 +00:00
premiere-plugin fix(premiere-plugin): hide growing-count badge until count > 0 2026-05-26 16:40:47 +00:00
web-ui chore: 1.2 ship-prep sweep — close 38 issues 2026-05-27 02:06:14 +00:00
worker fix(player): stitch S3 ranges around RustFS empty-body bug (#143) 2026-05-27 02:38:42 +00:00