fix: dedupe render-stage adds to prevent ghost re-renders - #20
Open
JRemitz wants to merge 1 commit into
Open
Conversation
The dock's render stage allowed two pending entries for the same
source clip, and `isClipInStage` only matched pending stage items --
not the CLI publish queue. The CLI derives the output filename
purely from the source clip stem (`{stem}_short.mp4`), so a second
render silently overwrites the first, looking to the user like a
"ghost re-render" of a clip they already shipped.
Fix:
- `addToStage` now refuses an add when an item with the same
clipPath is already pending OR already in the CLI publish queue.
- New `isClipInCliQueue(clipPath)` derives the expected output
filename pattern from clipPath and checks `cliItems` for a match.
- `ClipReviewPanel`'s yellow warning now distinguishes
"pending in render queue" vs "already rendered (in publish queue)"
so users see the right message in either state.
The earlier behaviour was clearly broken: a user with three rendered
clips, one errored, and three pending clicked "Render all" and saw a
previously-rendered output get overwritten -- because a duplicate
stage entry slipped past the check.
Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A user-reported bug: with 3 clips already rendered, 1 errored, and 3 pending, clicking "Render all" silently re-rendered one of the already-rendered clips (overwriting the output file on disk), while the errored clip stayed put.
Root cause traced to three things compounding:
addToStage(renderQueue.svelte.ts) just appends — no check for an existing pending stage item with the sameclipPath.isClipInStage(=isClipInQueuealias) only matches pending stage items. Once a clip is rendered and moves to the CLI publish queue, no warning shows on re-add.reeln-cli/reeln/commands/render.py:123derives the output filename purely from the source clip stem ({stem}_short.mp4). Two stage items pointing at the same source clip render to the same output and silently overwrite each other.Fix
addToStagerefuses an add when an item with the sameclipPathis already pending OR already in the CLI publish queue (logs an info-level "Refused duplicate" message instead of throwing).isClipInCliQueue(clipPath)derives the expected{dir}/shorts/{stem}_*.mp4pattern and checks againstcliItems.ClipReviewPanel's yellow warning now shows two distinct messages: "already pending in the render queue" vs. "already been rendered (in the publish queue)."renderAllcorrectly skippingstatus !== "pending"was the bit that worked — that's why the errored clip didn't retry, matching the user's observation.Test plan
npm test— full suite 115/115 green; 4 new tests cover dedup behaviour (pending, CLI queue, unrelated-clip negative case).npm run check— 0 errors (41 pre-existing a11y warnings unchanged).🤖 Generated with Claude Code