Skip to content

fix(studio): a host can own the live preview's load deadline, so a slow sealed film isn't an error - #8206

Merged
miguel-heygen merged 3 commits into
mainfrom
fix/sealed-preview-host-deadline
Nov 20, 2026
Merged

miguel-heygen merged 3 commits into
mainfrom
fix/sealed-preview-host-deadline

Conversation

@miguel-heygen

@miguel-heygen miguel-heygen commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

What changed

A sealed preview (sandboxOrigin="opaque") cannot be read by the player, so its composition probe never finds the timeline itself: only the film's runtime announcing ready makes it ready. The probe's 8 s deadline still runs, so a sealed film whose first load takes longer than 8 s errors with "Composition timeline not found after 8s", then comes up anyway once its runtime is ready.

NLEPreview now takes noLoadTimeout for its live slot and passes it to Player, as the shadow slot already does. A host that counts load time itself can hand the deadline over for the films it seals; slow loads still count there, as slow loads rather than errors. A host that does not pass it is unchanged, so Studio on its own keeps the 8 s error for a film that never loads.

This adds a prop only and changes no default, so it does not collide with #7846 (Studio sealed by default).

What I measured

  • NLEPreview.slowBoot.test.ts (green at the fix head once CI reports): a sealed live preview given noLoadTimeout whose runtime boots after 8 s raises no error and comes ready; the existing test still holds that a live slot without it keeps the 8 s deadline.
  • fails without the fix: the test was pushed alone first (0faefde); Test (studio) failed with the production error: expected [] ... received [{ message: "Composition timeline not found after 8s" }] at the 10 s mark (https://github.com/heygen-com/hyperframes/actions/runs/44379228916/job/135066796053). An earlier test-only push (bd0ed7c) failed for a different reason (the sealed player mounts after its frame-token fetch and the test read it too early), so it proved nothing; 0faefde stubs that fetch and waits.

Before

Studio from main (e83ddaed), built with the preview sealed, and its preview pane passing noLoadTimeout as a host would: a one-line change used only for these captures ({...({ noLoadTimeout: true } as object)} on PreviewPane's NLEPreview, so main compiles too), not part of this PR. The film's first load is held about 12 s by a script from a deliberately slow local server. Main's NLEPreview drops the prop: at 9.6 s "Preview failed to load: Composition timeline not found after 8s" shows, and it stays over the film after the timeline has loaded behind it.

Before: a slow sealed film on main

After

The same build steps and film at this branch (f5e9c050): no error, and the film comes up at 13.9 s.

After: the same slow sealed film on this branch

What I did NOT exercise

  • happy-dom does not make the frame opaque, so the test stands in for "the probe cannot read it" with a runtime that is late.
  • A retry (retryPreview) still drops no-load-timeout, as it already did for a promoted shadow slot.

@github-actions

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 271 (base branch 271), smooth 77 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Quarantined, measured but not gated (0)

Unstable (1)

  • seqplainkeys-none-center-r0-root-z100: tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true / tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true / tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes at f5e9c05. The code is the same as when I reviewed it, and it's fine. The required Studio and player captures check is red on the PR body: this change touches .tsx files, so the body needs a capture image, or a ## No visible change section if it qualifies (under 20 lines with no .tsx, .css or .html files, so it doesn't here).

Need: add a before and after capture of the sealed slow-boot preview to the body. Edit the body text first, because gh pr edit --body-file drops attachments. Then re-run the check and I'll approve at that head.

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review at f5e9c050. The head is the same commit I requested changes on, so the code is unchanged, and the code was fine then. My only ask was the red Studio and player captures check. The body now carries the before and after captures, and that check passed on its latest run (01:01Z). Every check at this head now ends in success or skipped. Approving.

Need: yes · Size: unchanged since my last review · Reuse: unchanged · Simpler: unchanged · Structure: unchanged

@miguel-heygen
miguel-heygen added this pull request to the merge queue Nov 20, 2026
Merged via the queue into main with commit 44d805c Nov 20, 2026
216 of 219 checks passed
@miguel-heygen
miguel-heygen deleted the fix/sealed-preview-host-deadline branch November 20, 2026 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants