Review round 12: project re-checked after the queue question too

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tw9fjX7o2YfeGQE18MEtPu
This commit is contained in:
Claude
2026-11-09 10:50:22 +00:00
parent 769f1f2179
commit 47b42440da
2 changed files with 11 additions and 0 deletions
+10
View File
@@ -327,3 +327,13 @@ test("a busy check that errors does not block Generate, and Stop ends the wait",
assert.ok(Date.now() - t < 3500, "the wait ended with Stop");
assert.equal(queued, 1, "no shot of the stopped run went");
});
test("a project opened while ComfyUI's queue is being asked about is not run", async () => {
let queued = 0;
const { app, doc } = rig("idle", { generate: async () => { queued += 1; return true; } });
app.has = new Set();
app.api.upscaleBusy = async () => ({ busy: false });
app.api.projectQueued = async () => { app.project.project = { ...doc, id: "Other" }; return false; };
await app.runner.units(["a"], 1);
assert.equal(queued, 0);
});
+1
View File
@@ -136,6 +136,7 @@ export default {
if (!p.project || p.project.id !== pid) { tell("Stopped: another project was opened."); break; } // the wait can take minutes
// The page's own guard does not see another tab: ComfyUI's queue does. Asked per shot: between this run's shots it is empty.
if (app.api.projectQueued && (await app.api.projectQueued(pid))) { tell("This project already has a run in ComfyUI's queue (another tab or window?). Wait for it, or Stop it there."); break; }
if (!p.project || p.project.id !== pid) { tell("Stopped: another project was opened."); break; } // the queue answer can take seconds
const done = g.waitForTerminal(); // listening before the run starts, so a fast one is not missed
said = false;
current = snap.scenes.findIndex((s) => s.id === root.id) + 1;