Skip to content

armgit / fuobe

Public Imported from GitHub
0

The open creative studio on ComfyUI: images, video, 3D and audio on open weights, on your own GPU or the cloud. Camera motions, effects, apps, Cinema, Layers, Image to 3D and an AI agent.

Mixed Media: a render's progress stays its own in the Trash

Adarsh27b3b8d9ad46
diff --git a/src/server/mixed-media.ts b/src/server/mixed-media.ts
index 56fc3a8e..62ade55f 100644
--- a/src/server/mixed-media.ts
+++ b/src/server/mixed-media.ts
@@ -410,8 +410,9 @@ export interface FramesProgress {
/** A per-frame render's frame edits at a glance (the page follows the main steps, not hundreds of frames), by its finished video's id. */
export function framesProgress(finalId: string): FramesProgress | null {
- // Another's render reads as gone (an account's to the owner, the owner's or another account's to an account).
- if (getGeneration(finalId) && !ownRender(finalId)) return null;
+ // Another's render reads as gone (an account's to the owner, the owner's or another account's to an account),
+ // in the Trash too: the steps are read from the table itself, so the check can't lean on the Library's view.
+ if (!ownRender(finalId)) return null;
const rows = renderSteps(finalId);
if (!rows) return getGeneration(finalId) ? { total: 0, done: 0, running: 0 } : null;
const frames = rows.filter((r) => r.feature === MIXED_FRAME_FEATURE);
diff --git a/tests/account-video-tools.test.ts b/tests/account-video-tools.test.ts
index 9b419fb6..7a53e458 100644
--- a/tests/account-video-tools.test.ts
+++ b/tests/account-video-tools.test.ts
@@ -354,6 +354,15 @@ describe("an account runs the video tools on its own ComfyUI", () => {
const p = await start(() => mixedPreviewRoute.POST(json("/api/mixed-media/preview", "POST", body, "a")));
expect(p.status, await p.clone().text()).toBe(201);
expect(getGeneration(((await p.json()) as { id: string }).id)!.request.account).toBe(a);
+ // In the Trash, the render is still its own alone: another account and the owner read it as gone.
+ db().prepare("INSERT OR IGNORE INTO generation_trash (generation_id, deleted_at) VALUES (?, ?)").run(final, Date.now());
+ expect(getGeneration(final)).toBeNull();
+ for (const who of ["b", "owner"] as const) {
+ const res = await mixedProgressRoute.GET(get(`/api/mixed-media/progress?id=${final}`, who));
+ expect(res.status, who).toBe(404);
+ expect(await res.json()).toEqual({ error: "This render no longer exists" });
+ }
+ expect((await mixedProgressRoute.GET(get(`/api/mixed-media/progress?id=${final}`, "a"))).status).toBe(200);
});
it("films a turnaround and a fly around end to end, never asking the studio's WorldCast worker", async () => {