From 48dac63aec063ea1acd434e848f83a62021f886f Mon Sep 17 00:00:00 2001 From: Benjamin Lu Date: Thu, 4 Dec 2025 18:52:40 -0800 Subject: [PATCH 1/3] Fix cloud cancel to target specific jobs --- src/components/queue/QueueProgressOverlay.vue | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/components/queue/QueueProgressOverlay.vue b/src/components/queue/QueueProgressOverlay.vue index cf4d88fbaa..8b0d99f3b0 100644 --- a/src/components/queue/QueueProgressOverlay.vue +++ b/src/components/queue/QueueProgressOverlay.vue @@ -75,6 +75,7 @@ import { useQueueProgress } from '@/composables/queue/useQueueProgress' import { useResultGallery } from '@/composables/queue/useResultGallery' import { useErrorHandling } from '@/composables/useErrorHandling' import { useAssetSelectionStore } from '@/platform/assets/composables/useAssetSelectionStore' +import { isCloud } from '@/platform/distribution/types' import { api } from '@/scripts/api' import { useAssetsStore } from '@/stores/assetsStore' import { useCommandStore } from '@/stores/commandStore' @@ -263,11 +264,19 @@ const cancelQueuedWorkflows = wrapWithErrorHandlingAsync(async () => { const interruptAll = wrapWithErrorHandlingAsync(async () => { const tasks = queueStore.runningTasks - await Promise.all( - tasks - .filter((task) => task.promptId != null) - .map((task) => api.interrupt(task.promptId)) - ) + const promptIds = tasks.map((task) => String(task.promptId)) + + if (!promptIds.length) return + + // Cloud backend supports cancelling specific jobs via /queue delete, + // while /interrupt always targets the "first" job. Use the targeted API + // on cloud to ensure we cancel the workflow the user clicked. + if (isCloud) { + await Promise.all(promptIds.map((id) => api.deleteItem('queue', id))) + return + } + + await Promise.all(promptIds.map((id) => api.interrupt(id))) }) const showClearHistoryDialog = () => { From 69a53676dc7135d80247e2d65c55c873beb2551a Mon Sep 17 00:00:00 2001 From: Benjamin Lu Date: Thu, 4 Dec 2025 18:58:14 -0800 Subject: [PATCH 2/3] Harden prompt id filtering --- src/components/queue/QueueProgressOverlay.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/queue/QueueProgressOverlay.vue b/src/components/queue/QueueProgressOverlay.vue index 8b0d99f3b0..53a0e04237 100644 --- a/src/components/queue/QueueProgressOverlay.vue +++ b/src/components/queue/QueueProgressOverlay.vue @@ -264,7 +264,10 @@ const cancelQueuedWorkflows = wrapWithErrorHandlingAsync(async () => { const interruptAll = wrapWithErrorHandlingAsync(async () => { const tasks = queueStore.runningTasks - const promptIds = tasks.map((task) => String(task.promptId)) + const promptIds = tasks + .map((task) => task.promptId) + .filter((id): id is string => typeof id === 'string' && id.length > 0) + .map((id) => String(id)) if (!promptIds.length) return From a67d8b6d363ee6811bb499db8c27235513a2a0e1 Mon Sep 17 00:00:00 2001 From: Benjamin Lu Date: Thu, 4 Dec 2025 19:04:21 -0800 Subject: [PATCH 3/3] Simplify prompt id map --- src/components/queue/QueueProgressOverlay.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/queue/QueueProgressOverlay.vue b/src/components/queue/QueueProgressOverlay.vue index 53a0e04237..a941af55aa 100644 --- a/src/components/queue/QueueProgressOverlay.vue +++ b/src/components/queue/QueueProgressOverlay.vue @@ -267,7 +267,6 @@ const interruptAll = wrapWithErrorHandlingAsync(async () => { const promptIds = tasks .map((task) => task.promptId) .filter((id): id is string => typeof id === 'string' && id.length > 0) - .map((id) => String(id)) if (!promptIds.length) return