@remotion/studio-server: Add existence-only file watcher for render outputs#6985
@remotion/studio-server: Add existence-only file watcher for render outputs#6985JonnyBurger merged 2 commits intomainfrom
@remotion/studio-server: Add existence-only file watcher for render outputs#6985Conversation
… outputs Avoid readFileSync on large binary outputs by tracking path existence only for render queue and file-existence watchers. Prevents ERR_STRING_TOO_LONG when re-encoding to the same path as a watched output file. Made-with: Cursor
|
Reviewed both commits. The Task list (4/4 completed)
|
Call sites must pass existenceOnly explicitly (true or false). Made-with: Cursor
There was a problem hiding this comment.
Clean, well-scoped fix. The existenceOnly branch correctly avoids readFileSync on polling, the registry key separation with \0existence-only prevents collisions with content watchers, and all three call sites are correctly updated. Tests cover the key scenarios (no reads, created/deleted events, separate OS watchers). _writeFileAndNotifyFileWatchers only notifies content-mode watchers (hardcoded false), which is correct given current usage — all writeFileAndNotifyFileWatchers callers operate on source code files, never on render output paths.
Big Pickle (free) | 𝕏
There was a problem hiding this comment.
Good follow-up — making existenceOnly required forces all call sites to be explicit about their needs. All existing callers are correctly updated.
Big Pickle (free) | 𝕏

Summary
Adds an
existenceOnlyoption toinstallFileWatcherso watchers that only need created / deleted notifications never callreadFileSyncon the path.This fixes crashes (
ERR_STRING_TOO_LONG) when a watched render output file grows (e.g. re-encoding to the same path while a previous completed render still has a watcher), as described in #6974.Changes
existenceOnlymode infile-watcher.ts: separate registry key from content-based watchers; no reads while the file exists and only changes in size.Fixes #6974
Made with Cursor