From 9124c5836d3226f8f3800c05f38dacbc8cdf18ec Mon Sep 17 00:00:00 2001 From: Renn F Date: Mon, 6 Jul 2026 02:38:10 +0200 Subject: [PATCH] fix(video): reclaim outDir on createRenderJob throw + hide empty 4th highlight MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Final whole-branch review (Opus) triaged two FIX items from the SDD nits ledger; the rest ship as-is. - render.js: a synchronous throw from createRenderJob (post-mkdtemp, not awaited) left an empty outDir on disk — the outer catch only reclaimed extractDir. Reclaim outDir too when it exists, and correct the stale comment that claimed the out dir was never created. - {vertical,square}.html: the 4th highlights
  • lived in the DOM hidden only by JS, so a no-JS / failed-script render would show an empty bullet. Start it style="display:none" and reveal on populate, so an unscripted render shows nothing instead. Vitest smoke (release-announcement.test.js) 4/4 green; render.js syntax checked. Python suite untouched by this fix (JS/HTML only). --- motion/compositions/release-announcement/square.html | 3 ++- motion/compositions/release-announcement/vertical.html | 3 ++- video-renderer/render.js | 9 +++++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/motion/compositions/release-announcement/square.html b/motion/compositions/release-announcement/square.html index 875d44f7..a5f113c8 100644 --- a/motion/compositions/release-announcement/square.html +++ b/motion/compositions/release-announcement/square.html @@ -24,7 +24,7 @@
  • Fable-mode adopted fleet-wide
  • FE/UX-UI design bar shipped
  • Feature spotlight goes live on X
  • -
  • + @@ -68,6 +68,7 @@ if (!textEl) continue; if (i < highlights.length && highlights[i]) { textEl.textContent = String(highlights[i]); + items[i].style.display = ""; } else { items[i].style.display = "none"; } diff --git a/motion/compositions/release-announcement/vertical.html b/motion/compositions/release-announcement/vertical.html index 294dc099..5a0c4ba5 100644 --- a/motion/compositions/release-announcement/vertical.html +++ b/motion/compositions/release-announcement/vertical.html @@ -23,7 +23,7 @@
  • Fable-mode adopted fleet-wide
  • FE/UX-UI design bar shipped
  • Feature spotlight goes live on X
  • -
  • + @@ -67,6 +67,7 @@ if (!textEl) continue; if (i < highlights.length && highlights[i]) { textEl.textContent = String(highlights[i]); + items[i].style.display = ""; } else { items[i].style.display = "none"; } diff --git a/video-renderer/render.js b/video-renderer/render.js index 6cbd2df8..6e36fc9c 100644 --- a/video-renderer/render.js +++ b/video-renderer/render.js @@ -127,9 +127,14 @@ export async function renderComposition({ ]), }; } catch (err) { - // On any pre-render failure the out dir was never created — only the - // extract dir needs reclaiming. Re-throw so server.js maps it to 4xx/5xx. + // Reclaim whatever temp dirs exist. outDir is created at the mkdtemp + // above, so a sync throw from createRenderJob (post-mkdtemp, not + // awaited) leaves an empty outDir behind — reclaim it too. Re-throw + // so server.js maps the failure to 4xx/5xx. await rm(extractDir, { recursive: true, force: true }).catch(() => {}); + if (outDir) { + await rm(outDir, { recursive: true, force: true }).catch(() => {}); + } throw err; } } \ No newline at end of file