mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-16 06:19:21 +00:00
The batched persist path (persistTimelineElementsMove, used for lane-change and insert moves) patched only data-start/data-track-index and never synced the root data-duration. So after moving a clip past the old content end, the player showed the right length (effectiveDuration = live max over clips) but the saved FILE kept a stale data-duration — and a render off that file would truncate at the stale value. This is the "moved audio to ~11.5s, it ends at 19.53s, but the file still says data-duration=15.18" case (HANDOFF-3 §6.1). Mirror the single-clip move path: after patching, recompute the furthest clip end for the file (resolveMovedContentEnd, using each edit's new start) and setCompositionDurationToContent (grow OR shrink). Extracted the content-end calc as a pure exported helper and covered it + the persist write with tests, including a persist-level test asserting the saved source string (the G2 persist-source boundary the prior overlap bug hid behind).