fix: use prompt_id to update correct job in execution handlers

handleExecutionCached and handleExecuted were updating activeJob, which
breaks when the focused job differs from the active job. Look up the job
by e.detail.prompt_id in queuedJobs instead.

Addresses review feedback:
https://github.com/Comfy-Org/ComfyUI_frontend/pull/9786#discussion_r2926758475
This commit is contained in:
bymyself
2026-03-13 09:30:53 -07:00
parent 638f1b9938
commit c2c4f84d24

View File

@@ -274,9 +274,10 @@ export const useExecutionStore = defineStore('execution', () => {
}
function handleExecutionCached(e: CustomEvent<ExecutionCachedWsMessage>) {
if (!activeJob.value) return
const job = queuedJobs.value[e.detail.prompt_id]
if (!job) return
for (const n of e.detail.nodes) {
activeJob.value.nodes[n] = true
job.nodes[n] = true
}
}
@@ -289,8 +290,9 @@ export const useExecutionStore = defineStore('execution', () => {
}
function handleExecuted(e: CustomEvent<ExecutedWsMessage>) {
if (!activeJob.value) return
activeJob.value.nodes[e.detail.node] = true
const job = queuedJobs.value[e.detail.prompt_id]
if (!job) return
job.nodes[e.detail.node] = true
}
function handleExecutionSuccess(e: CustomEvent<ExecutionSuccessWsMessage>) {