Skip to content

@remotion/studio-server: Add existence-only file watcher for render outputs#6985

Merged
JonnyBurger merged 2 commits intomainfrom
existence-only-file-watcher-9n4
Apr 4, 2026
Merged

@remotion/studio-server: Add existence-only file watcher for render outputs#6985
JonnyBurger merged 2 commits intomainfrom
existence-only-file-watcher-9n4

Conversation

@JonnyBurger
Copy link
Copy Markdown
Member

Summary

Adds an existenceOnly option to installFileWatcher so watchers that only need created / deleted notifications never call readFileSync on 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

  • existenceOnly mode in file-watcher.ts: separate registry key from content-based watchers; no reads while the file exists and only changes in size.
  • Enabled for: client render output watcher, CLI render queue output watcher, and file-existence watchers.

Fixes #6974

Made with Cursor

… 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
@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Apr 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
bugs Ready Ready Preview, Comment Apr 4, 2026 2:21pm
remotion Ready Ready Preview, Comment Apr 4, 2026 2:21pm

Request Review

@pullfrog
Copy link
Copy Markdown
Contributor

pullfrog bot commented Apr 4, 2026

Reviewed both commits. The existenceOnly mode correctly avoids readFileSync on polling for render output watchers, fixing the ERR_STRING_TOO_LONG crash. The follow-up commit making existenceOnly required is a good improvement. No actionable issues found — approved.

Task list (4/4 completed)
  • Read the full diff and PR context
  • Read the changed files in full for deeper understanding
  • Analyze correctness and edge cases
  • Submit review or report progress

Pullfrog  | View workflow run | Triggered by Pullfrog | Using Big Pickle (free) | 𝕏

Call sites must pass existenceOnly explicitly (true or false).

Made-with: Cursor
Copy link
Copy Markdown
Contributor

@pullfrog pullfrog bot left a comment

Choose a reason for hiding this comment

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

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.

Pullfrog  | View workflow run | Using Big Pickle (free) | 𝕏

Copy link
Copy Markdown
Contributor

@pullfrog pullfrog bot left a comment

Choose a reason for hiding this comment

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

Good follow-up — making existenceOnly required forces all call sites to be explicit about their needs. All existing callers are correctly updated.

Pullfrog  | View workflow run | Using Big Pickle (free) | 𝕏

@JonnyBurger JonnyBurger merged commit 3a445f8 into main Apr 4, 2026
20 checks passed
@JonnyBurger JonnyBurger deleted the existence-only-file-watcher-9n4 branch April 4, 2026 14:42
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.

Crash in Studio

1 participant