@remotion/studio: Fix sequence props watcher warning on scrub#6947
@remotion/studio: Fix sequence props watcher warning on scrub#6947JonnyBurger merged 4 commits intomainfrom
@remotion/studio: Fix sequence props watcher warning on scrub#6947Conversation
Multiple timeline items mapping to the same AST node path (e.g. Videos inside a .map()) caused the server to deduplicate their watchers into one, but each item still sent its own unsubscribe on unmount. The first unsubscribe removed the watcher; subsequent ones hit "watcher does not exist". Fix: reference-count watchers per key so the file watcher is only removed when the last subscriber unsubscribes. Also adds a `cancelled` flag to the client-side subscription hook to prevent stale promise resolutions from writing to refs after cleanup, and a test composition reproducing #6727. Closes #6727 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Reviewed the refcount and cancellation changes. Submitted one inline comment about a minor session-scoped refCount leak when a subscribe response arrives after effect cleanup — low severity since Task list (5/5 completed)
|
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Refcount approach and cancellation flag are both correct. One minor concern about a potential refCount leak when a subscribe response arrives after effect cleanup — detailed in the inline comment. Not blocking since it's bounded by client session lifetime.
Big Pickle (free) | 𝕏
packages/studio/src/components/Timeline/use-sequence-props-subscription.ts
Outdated
Show resolved
Hide resolved
`computeSequencePropsStatusFromContent` throws when the AST node path is no longer valid (e.g. after formatting moves the JSX element). This uncaught error inside the file watcher callback crashed the server. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The flag prevents stale writes but leaks a refCount on the server since the compensating unsubscribe is never sent. The race window is narrow (localhost RTT) and disconnect cleanup handles it, so remove it. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Summary
<Video>inside.map()) share one file watcher, which is only removed when the last subscriber unsubscribescancelledflag to the client-side subscription hook to prevent stale promise resolutions from writing to refs after effect cleanupcascading-premounttest composition reproducing the scenario from Premounting does not work as indicator would lead you to believe #6727Closes #6727
Test plan
cascading-premountcomposition in Studio with visual mode enabledbun run buildpassesbun run stylecheckpasses🤖 Generated with Claude Code