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:
@@ -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);
|
||||
});
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user