diff --git a/packages/producer/src/services/distributed/rebuildExtractedFrames.test.ts b/packages/producer/src/services/distributed/rebuildExtractedFrames.test.ts new file mode 100644 index 0000000000..d45fa1c79f --- /dev/null +++ b/packages/producer/src/services/distributed/rebuildExtractedFrames.test.ts @@ -0,0 +1,153 @@ +/** + * Regression guard for HF#1731 / HF#1730 — pins the 0-based `framePaths` + * key convention on `rebuildExtractedFramesFromPlanDir`. + * + * Why a separate file from `renderChunk.test.ts`: that file's top-level + * `beforeAll` boots a Chrome smoke probe so the byte-identical-retry + * assertions can soft-skip on hosts where chrome-headless-shell can't + * initialize. The probe is a 5-15s tax on the whole module even when no + * Chrome-dependent test runs. This file is pure-filesystem and stays + * Chrome-free so the regression check runs in ~10ms on every PR. + * + * The bug: the consumer of `framePaths` is + * `videoFrameExtractor.ts:getFrameAtTime`, which computes + * `Math.floor(localTime * fps + 1e-9)` (0-based) and reads + * `framePaths.get(frameIndex)`. The pre-fix code in + * `rebuildExtractedFramesFromPlanDir` wrote `framePaths.set(i + 1, …)` + * instead of `framePaths.set(i, …)`, so `framePaths.get(0)` returned + * `undefined` at every `