Browse Source

fix: update VideoStitch thumbnails when upstream videos re-execute

The clipKey dependency used a presence-only check ("1"/"0"), so when a
video re-generated (truthy→truthy), the effect never re-ran. Additionally,
the ref-based cache keyed by edgeId returned stale thumbnails even if the
effect did fire. Fix by fingerprinting video data via its trailing 20 chars
and clearing the thumbnail cache when clipKey changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
handoff-20260429-1057
shrimbly 5 months ago
parent
commit
67b085b4cc
  1. 3
      src/components/nodes/VideoStitchNode.tsx

3
src/components/nodes/VideoStitchNode.tsx

@ -123,7 +123,7 @@ export function VideoStitchNode({ id, data, selected }: NodeProps<VideoStitchNod
// Stable key that only changes when clip edges or video data actually change
const clipKey = useMemo(
() => orderedClips.map((c) => `${c.edgeId}:${c.videoData ? "1" : "0"}`).join(","),
() => orderedClips.map((c) => `${c.edgeId}:${c.videoData ? c.videoData.slice(-20) : "0"}`).join(","),
[orderedClips]
);
@ -135,6 +135,7 @@ export function VideoStitchNode({ id, data, selected }: NodeProps<VideoStitchNod
let cancelled = false;
const extractThumbnails = async () => {
thumbnailsRef.current = new Map();
const newThumbnails = new Map<string, string>();
for (const clip of orderedClips) {

Loading…
Cancel
Save