Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: stop reporting a successful cancel once the overlay capture is over (#8984)

[._.]/ Adam Eivy7ba2f3431621
diff --git a/server/services/musicVideo/render.js b/server/services/musicVideo/render.js
index 4ec4c319b2..1642a992c4 100644
--- a/server/services/musicVideo/render.js
+++ b/server/services/musicVideo/render.js
@@ -105,7 +105,7 @@ export function cancelRender(jobId) {
// A composed render spends its first phase capturing the typography overlay
// (no ffmpeg yet); abort that capture instead.
if (!job.process) {
- if (!job.overlayAbort || job.overlayAbort.signal.aborted) return false;
+ if (job.status !== 'running' || !job.overlayAbort || job.overlayAbort.signal.aborted) return false;
job.overlayAbort.abort(new Error('Render cancelled'));
return true;
}
@@ -538,6 +538,8 @@ export async function renderMusicVideo(projectId) {
onProgress: (fraction) => broadcastSse(job, { type: 'progress', progress: 0.5 * fraction }),
}).then((overlays) => {
signal.throwIfAborted();
+ // Capture is over: from here a cancel kills the encode (job.process).
+ job.overlayAbort = null;
const composed = buildMusicVideoFfmpegArgs(clips, audioPath, outputPath, { audioDurationSec, overlays });
startEncode(composed.args, 0.5);
}).catch(async (err) => {
diff --git a/server/services/musicVideo/render.terminal.test.js b/server/services/musicVideo/render.terminal.test.js
index 8475948032..05dbfaf8da 100644
--- a/server/services/musicVideo/render.terminal.test.js
+++ b/server/services/musicVideo/render.terminal.test.js
@@ -388,5 +388,7 @@ describe('composed render lifecycle (#8984)', () => {
expect(generateThumbnail).toHaveBeenCalledWith(expect.any(String), jobId, { atSec: 1 });
expect(getRenderJobStatus(jobId).status).toBe('complete');
expect(removeCompositionScratch).toHaveBeenCalledWith(jobId);
+ // Nothing is left to cancel once the render has finished.
+ expect(cancelRender(jobId)).toBe(false);
});
});