hyperframes icon indicating copy to clipboard operation
hyperframes copied to clipboard

producer: a failed remote media fetch is silently dropped from the render

Open jerrai-bot-heygen opened this issue 1 month ago • 4 comments

Summary

When a composition references remote media (<video>, <audio>, <source> or <img> with an https:// src) and the download fails at render time, the producer drops the element silently: it gets duration 0 and is excluded from the render. The render succeeds and nothing tells the caller that the output is missing media it was asked to include.

Where

packages/producer/src/services/htmlCompiler.ts at 7e92aec:

  • resolveMediaDuration (L492): the catch at L512-516 returns { duration: null, resolvedPath: src } with the comment "Download failed (e.g. 404 placeholder URL) — skip gracefully. The element will get duration 0 and be excluded from the render."
  • The same function's local branch, L524-525: a referenced local file that doesn't exist also returns duration: null, with the same effect.
  • downloadAndRewriteUrls (L1437) reports download failures only through console.warn.

Repro shape

  1. Make a composition with <video src="https://example.com/does-not-exist.mp4" data-start="0" data-duration="5"> (or a signed URL that has expired) next to other media.
  2. Render it.
  3. The render completes. The video is absent from the output and the timeline is shorter. No error, and no warning in the render result.

Typical real-world cause: a pre-signed media URL that expired between authoring and rendering.

Ask

A media fetch that fails, or a referenced file that is missing, should surface as a typed render warning or error in the render result: which element, which src, and why (HTTP status, timeout, SSRF block, missing file). It shouldn't silently shrink the output. Whether the default is to fail the render or warn and continue is your call, but the caller needs to be able to tell.

cc @miguel-heygen (HF framework)

— Jerrai

jerrai-bot-heygen avatar Oct 28 '26 00:10 jerrai-bot-heygen

I investigated this against current main (2d3033c7). The originally reported silent-success behavior no longer reproduces: unavailable video/audio sources fail rendering, and failed images produce structured warnings.

I did find a narrower diagnostic gap: terminal video extraction metadata loses the exact HTTP status (e.g. 403 vs. 404) and the owning element's identity.

I've prepared a focused, tested candidate fix here: https://github.com/Muzzy5150/hyperframes/commit/151a1d22e63966a1b2243b10eb55aae576fcc6ce

The new regression cases fail on upstream and pass with the change. The patch preserves exact HTTP status and a hashed element identifier without forwarding raw paths, signed URLs, or credentials. It doesn't change download attempts or render failure policy.

Before opening a PR, I'd like to confirm the intended compatibility contract from #3592. The patch currently adds status and elementFingerprint to the existing schemaVersion: 1 group. Should those be accepted as optional v1 fields, or would you prefer a versioned change?

I'm also reviewing whether the additional human-readable context should remain separate from downstream host-redaction policy, and whether grouping should remain per source rather than per element.

Happy to adjust the implementation to the preferred contract before submitting.

Muzzy5150 avatar Oct 28 '26 11:10 Muzzy5150

Thanks. @Muzzy5150 reports that on current main a missing remote video or audio source now fails the render, and a failed image fetch shows up as a warning, so what's left may only be a diagnostic gap (the error loses the HTTP status and which element it was). Can you confirm whether you still see a render succeed with media missing on 0.9.x, and for which element type? If not, we'll narrow this issue to the diagnostic gap.

jrusso1020 avatar Nov 05 '26 02:11 jrusso1020

This issue is waiting on the information requested above and has had no activity for 14 days. It will close in 7 days unless someone adds a comment.

github-actions[bot] avatar Nov 19 '26 09:11 github-actions[bot]

Closed because the requested information didn't arrive. Comment with the details and we'll reopen it.

github-actions[bot] avatar Nov 26 '26 09:11 github-actions[bot]