fix: use e.detail.prompt_id consistently in handleExecutionInterrupted and handleExecutionSuccess

Previously these handlers mixed activeJobId with e.detail.prompt_id,
which would cause bugs during concurrent execution when the active job
differs from the job being interrupted/completed.
This commit is contained in:
bymyself
2026-03-14 21:44:22 -07:00
parent eca084484d
commit 3a3ea0cce4

View File

@@ -285,7 +285,7 @@ export const useExecutionStore = defineStore('execution', () => {
e: CustomEvent<ExecutionInterruptedWsMessage>
) {
const jobId = e.detail.prompt_id
if (activeJobId.value) clearInitializationByJobId(activeJobId.value)
clearInitializationByJobId(jobId)
resetExecutionState(jobId)
}
@@ -296,12 +296,10 @@ export const useExecutionStore = defineStore('execution', () => {
}
function handleExecutionSuccess(e: CustomEvent<ExecutionSuccessWsMessage>) {
if (isCloud && activeJobId.value) {
useTelemetry()?.trackExecutionSuccess({
jobId: activeJobId.value
})
}
const jobId = e.detail.prompt_id
if (isCloud && jobId) {
useTelemetry()?.trackExecutionSuccess({ jobId })
}
resetExecutionState(jobId)
}