Repository navigation
fix(studio): a sealed move that rewrites no script rebinds in place instead of reloading the film - #8814
fix(studio): a sealed move that rewrites no script rebinds in place instead of reloading the film#8814miguel-heygen wants to merge 8 commits into
Conversation
… load for the next delete
…nstead of reloading the film
…module, so no import cycle
terencecho
left a comment
There was a problem hiding this comment.
P2 — Reload when the live timing patch did not apply. packages/studio/src/hooks/previewTimingPatch.ts:67–70 silently returns on a missing handle and discards the boolean from editPreviewElement(...).drawn. sealedTimingQueue.ts:18–21 then suppresses the reload whenever the separate rebind answers true. That answer only means the frame rebuilt timing from its current attributes. If the live patch missed or was refused, the save can succeed while the frame stays on the old timing. The previous sealed fallback reloaded from disk in this case. Carry the patch result into the rebind decision and test a saved edit whose frame patch was unavailable.
The captures job is red because it found no Before/After evidence in the body or an eligible author comment. Please also name previewTimingPatch.browser.test.ts or its test title directly on the fails without the fix: line. Captures check
— tai (automated review)
|
Fixed at 89be938: the patch result now feeds the reload decision.
Captures: posted separately as their own comment once the real-app walk finishes. |
terencecho
left a comment
There was a problem hiding this comment.
The missed-patch path now requests a reload. A separate playback regression remains.
P2 — A queued rebind can rewind a newer scrub. packages/studio/src/hooks/timelineTimingSync.ts:94–96 captures the playhead time before the queued callback runs. sealedTimingQueue.ts:24–29 sends that older time after waiting for the earlier patch, and the frame seeks to it. A scrub while that patch is outstanding can therefore be undone. The previous head reproduced this in Chrome, and a focused check of this head confirms the same queue behavior. Preserve the frame’s current playhead or guard the rebind against a newer seek. Cover a scrub while the patch is awaiting its reply.
The captures check is still red at this head. The current fails without the fix: line also still refers to the test indirectly. Please put previewTimingPatch.browser.test.ts on that line. Captures check
— tai (automated review)
No visible changeThe film looks the same before and after in both modes: the change is in when the frame catches up, not what it draws. A move that rewrites no script used to send a sealed film to a full reload, which Studio draws behind its shadow preview, so there is no frame to capture. The proof is the browser test below, which drives Studio's own timing sync against a real sealed frame. A real-app walk (Desktop linked to this branch's packages, Linux, a clip dragged past the film's end, then deleted) gives the same picture and timings on this branch and on main, so it does not separate the two; it is not offered as evidence of the fix. fails without the fix: |
terencecho
left a comment
There was a problem hiding this comment.
The rebind now reads the playhead when its queued callback runs. A focused comparison sent the old time at the previous head and the newer scrub time at this head. The captures check passed.
The remaining requirement is the PR body’s fails without the fix: line. It still says “the test commit” without naming the test. Please add previewTimingPatch.browser.test.ts or the new timelineTimingSync.sealed.test.ts regression directly to that line.
— tai (automated review)
|
The description is kept exactly as first posted (only its capture sections may change), so the fail-first evidence is named here instead: fails without the fix: |
Edit accuracy: accurate 273 (base branch 271), smooth 84 of thoseThe gate passes. Newly passing (2)
Not banked yet, reported and not gated (bank a full-grid run's baseline.json) (2)
Quarantined, measured but not gated (0) |
|
The description stays as first posted, so here is that line with the tests named: fails without the fix: |
# Conflicts: # packages/studio/src/hooks/previewTimingPatch.browser.test.ts
What
A timeline move or resize whose save rewrites no script now keeps a sealed preview's film loaded, as it already does in a frame Studio can script. Studio asks the frame to re-derive its clip windows from the live timing attributes (a new
rebind-timingrequest), instead of reloading the whole film. A delete made right after the move then lands on the same load and takes the clip out at once.Why
A sealed preview must give exactly the same output as an unsealed one. After a move that rewrote no script, Studio rebinds the timing in place (
applySoftReloadFinalization), which reads the frame's window directly. A sealed frame refuses that read, so the rebind reported failure and Studio fell back toreloadPreview(). The refresh then could not swap scenes on a plain film and reloaded it whole. In a real-app walk (drag a clip past the film's end, then delete it), a sealed film reloaded after the move in 11 of 15 runs and an unsealed one in 0 of 3. A delete sent while that reload ran got no answer from the frame, so the clip stayed drawn until the next load (2 of 5 instrumented sealed runs; 0 of 3 unsealed).Related work
Follows #8684 (sealed timing patches) and #8719 (sealed clip removal), whose delete this keeps on one load. Same port pattern as
live-retime(packages/core/src/runtime/editing/liveRetime.ts:244) and the sealed soft reload (packages/studio/src/utils/gsapSoftReload.ts:238).How
packages/core/src/runtime/editing/rebindTiming.ts, new):rebind-timingtakes one finite, non-negativetimeand nothing else (validated ineditingPort.tslikeset-loop-start). It runs the runtime's ownfinalizeSoftReloadunder__hfSuppressSceneMutationsand answers{ rebound: true }. It answers{ rebound: false }while a scene swap waits (its own rebind follows, asliveRetimedoes) or when the runtime has no rebind hook. No page script runs.hooks/previewTimingPatch.ts,rebindIframeTiming): one owner for "rebind in place, else reload". In a sealed frame the request joins the frame'sinOrderqueue, behind the move's own timing patches and ahead of any later delete. Anything but{ rebound: true }(no answer, a refusal, a runtime without the request) reloads exactly as before. An unsealed frame keepsapplySoftReloadFinalization.hooks/timelineTimingSync.tscalls it where it called the unsealed-only rebind.timelineTrackVisibility.ts:149(hiding a track) falls back to a seek, not a reload, when the rebind is refused. That is a separate gap, left for its own change.Test plan
previewTimingPatch.browser.test.ts(real Chrome, unsealed and sealed): a move that rewrites no script hides the moved clip in place with no reload, and a delete right after it leaves the same load.fails without the fix: the test commit, run alone, fails the sealed case (
the rebind hides #b, which now starts at 3 s: expected false to be true); the 5 other cases pass.Breaking the frame side (
rebind-timingalways answers{ rebound: false }) fails the sealed case again; the unsealed case still passes.editingAgent.test.ts: the request rebinds, refuses a negative, NaN, missing or extra parameter, and answers{ rebound: false }while a swap waits or with no rebind hook. Dropping the swap check fails it.editingAgent.test.ts(189),editingPort.test.ts(13),previewTimingPatch.test.ts,timelineTimingSync.test.ts(29),timelineTimingSync.sealed.test.ts, and the browser test (6) pass. Core and Studio type checks pass.Unit tests added/updated
Manual testing performed
Documentation updated (if applicable)
Comments follow CONTRIBUTING.md "Comments": they say why, not what, and a bug fix says what the code must do and how to reproduce the bug
Before and After captures from the real-app walk follow in a comment on this PR.