Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

fix(ui): finish bulk queue actions past the first failure

joshistoast7c4945acd503
diff --git a/invokeai/frontend/webv2/public/locales/en.json b/invokeai/frontend/webv2/public/locales/en.json
index c7383f8708..b2aa3a2cdc 100644
--- a/invokeai/frontend/webv2/public/locales/en.json
+++ b/invokeai/frontend/webv2/public/locales/en.json
@@ -1023,6 +1023,7 @@
"pruneFailed": "Prune failed",
"pull": "Pull",
"queueActionFailed": "Queue action failed",
+ "queueActionPartialDescription": "{{failed}} of {{total}} failed: {{error}}",
"refreshList": "Refresh model list",
"reidentify": "Re-identify model",
"reidentifyFailed": "Re-identify failed",
diff --git a/invokeai/frontend/webv2/src/features/models/ui/install-queue/InstallJobRow.tsx b/invokeai/frontend/webv2/src/features/models/ui/install-queue/InstallJobRow.tsx
index 538ff4b902..29d49c02a2 100644
--- a/invokeai/frontend/webv2/src/features/models/ui/install-queue/InstallJobRow.tsx
+++ b/invokeai/frontend/webv2/src/features/models/ui/install-queue/InstallJobRow.tsx
@@ -59,6 +59,9 @@ export const InstallJobRow = ({
assertAccountScopeCurrent(owner);
if (result && typeof result === 'object' && 'id' in (result as ModelInstallJob)) {
replaceInstallJob(result as ModelInstallJob);
+ // A coalesced refresh already in flight can clobber the optimistic
+ // row with a stale snapshot; revalidating converges on server truth.
+ void refreshInstalls(owner);
} else {
await refreshInstalls(owner);
}
diff --git a/invokeai/frontend/webv2/src/features/models/ui/install-queue/InstallQueueBar.tsx b/invokeai/frontend/webv2/src/features/models/ui/install-queue/InstallQueueBar.tsx
index abddb04e2d..13fc96d98a 100644
--- a/invokeai/frontend/webv2/src/features/models/ui/install-queue/InstallQueueBar.tsx
+++ b/invokeai/frontend/webv2/src/features/models/ui/install-queue/InstallQueueBar.tsx
@@ -13,7 +13,7 @@ import {
refreshInstalls,
useInstallsSelector,
} from '@features/models/data/installsStore';
-import { useScopedAction } from '@features/models/ui/shared/useScopedAction';
+import { getErrorMessage, useScopedAction } from '@features/models/ui/shared/useScopedAction';
import { setQueueExpanded, useModelsUiSelector } from '@features/models/ui/uiStore';
import { useNotify } from '@features/models/ui/useModelsNotify';
import { useMountEffect } from '@platform/react/useMountEffect';
@@ -66,10 +66,24 @@ export const InstallQueueBar = () => {
) =>
run(
async (owner) => {
- await Promise.all(targets.map((job) => call(job.id, owner.signal)));
+ // allSettled: one failed job must not hide the others' outcomes,
+ // and the requests that succeeded still deserve a fresh list.
+ const results = await Promise.allSettled(targets.map((job) => call(job.id, owner.signal)));
assertAccountScopeCurrent(owner);
await refreshInstalls(owner);
assertAccountScopeCurrent(owner);
+
+ const failures = results.filter((result): result is PromiseRejectedResult => result.status === 'rejected');
+ if (failures.length > 0) {
+ notify.error(
+ t('models.queueActionFailed'),
+ t('models.queueActionPartialDescription', {
+ error: getErrorMessage(failures[0]!.reason),
+ failed: failures.length,
+ total: targets.length,
+ })
+ );
+ }
},
(message) => {
notify.error(t('models.queueActionFailed'), message);