Files
hyperframes/packages
Miguel Ángel 00b96d2eaa fix(producer): fall back to copying extracted frames when symlink hits EPERM
* fix(producer): fall back to copying extracted frames when symlink hits EPERM

materializeExtractedFramesForCompiledDir stages each video's extracted
frames into the compiled dir via a single symlink (the in-process
renderer's default; distributed plan() already copies via
materializeSymlinks). Windows without Developer Mode (or Administrator)
cannot create symlinks and rejects with EPERM, so high/standard-quality
renders failed there — while draft quality worked because it avoids the
symlinked-cache path entirely.

Fix: a new stageExtractedFrameDir helper catches EPERM/EACCES from
symlinkSync and falls back to the same recursive cpSync the
materializeSymlinks path already uses. The extra disk is far better than
a hard render failure on a default Windows configuration. Non-permission
errors (ENOSPC, etc.) still propagate so real failures aren't masked as
silent copies. Extracting the helper also keeps the main function under
the complexity gate.

Test: two new cases via the injected fileSystem — symlinkSync throwing
EPERM triggers exactly one recursive cpSync (frames still remapped under
compiledDir), and a non-permission error (ENOSPC) rethrows without
falling back to copy. Full renderOrchestrator suite (81) passes.

* fix(producer): recover from a stale dangling frame-symlink (EEXIST)

Follow-up to this PR's EPERM copy fallback, from a further Windows report: the
symlink fails with EEXIST after the extraction cache is GC'd. A prior render's
symlink at the compiled linkPath dangles once its target is removed; the
caller's existsSync() guard follows the dead link and reads it as absent, so
staging runs again, but the link file still exists and symlinkSync collides
with EEXIST -> the render hard-fails.

Catch EEXIST in stageExtractedFrameDir, clear the stale entry (rmSync), and
re-stage (link, or copy on EPERM/EACCES). Factored the link-or-copy into a
helper reused by both the first attempt and the retry. rmSync is an optional
injected fs method (default fs supplies it; only the EEXIST path calls it).
New unit test covers the dangling-symlink recovery.

* fix(producer): widen symlink fallback to UNKNOWN and cover EEXIST on copy path

Addresses review nits on the frame-staging fallback:
- Widen the symlink no-privilege catch from EPERM/EACCES to also include
  UNKNOWN (some Windows builds surface a symlink privilege denial as UNKNOWN).
- Wrap the EEXIST stale-entry recovery around BOTH staging branches, not just
  the symlink one: after #2025 Windows uses the eager cpSync path, which can
  collide with a dangling symlink left by a prior Linux run — now it clears the
  stale entry and re-stages either way.
- Emit a one-time INFO log when symlinking degrades to copying, so a heavier
  Windows render is self-explanatory.
2026-07-07 17:10:17 -04:00
..
2026-07-07 20:30:24 +00:00
2026-07-07 20:30:24 +00:00
2026-07-07 20:30:24 +00:00
2026-07-07 20:30:24 +00:00
2026-07-07 20:30:24 +00:00
2026-07-07 20:30:24 +00:00
2026-07-07 20:30:24 +00:00
2026-07-07 20:30:24 +00:00
2026-06-16 13:16:09 -04:00
2026-07-07 20:30:24 +00:00
2026-07-07 20:30:24 +00:00
2026-07-07 20:30:24 +00:00