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): prune finished install progress entries

joshistoastc039d68dd9fb
diff --git a/invokeai/frontend/webv2/src/features/models/data/installsStore.test.ts b/invokeai/frontend/webv2/src/features/models/data/installsStore.test.ts
index b67b5ced0e..c319fcde1c 100644
--- a/invokeai/frontend/webv2/src/features/models/data/installsStore.test.ts
+++ b/invokeai/frontend/webv2/src/features/models/data/installsStore.test.ts
@@ -28,6 +28,17 @@ beforeEach(() => {
});
describe('model install event interpretation', () => {
+ it("prunes a job's transient progress when it settles", async () => {
+ const store = await import('./installsStore');
+
+ store.handleModelInstallSocketEvent('model_install_download_progress', { bytes: 25, id: 7, total_bytes: 100 });
+ expect(store.getInstallProgress(7)).toEqual({ bytes: 25, totalBytes: 100 });
+
+ store.handleModelInstallSocketEvent('model_install_complete', { config: {}, id: 7, source: 'org/model' });
+
+ expect(store.getInstallProgress(7)).toBeNull();
+ });
+
it('projects download progress immediately and coalesces the REST refresh', async () => {
const store = await import('./installsStore');
diff --git a/invokeai/frontend/webv2/src/features/models/data/installsStore.ts b/invokeai/frontend/webv2/src/features/models/data/installsStore.ts
index 0de4b8d018..f22abf031a 100644
--- a/invokeai/frontend/webv2/src/features/models/data/installsStore.ts
+++ b/invokeai/frontend/webv2/src/features/models/data/installsStore.ts
@@ -230,6 +230,12 @@ export const handleModelInstallSocketEvent = (
return;
}
+ if (event === 'model_install_complete' || event === 'model_install_error' || event === 'model_install_cancelled') {
+ // The settled job stays listed until "Clear finished", but its byte
+ // progress is dead weight the moment it stops downloading.
+ progressByJobId.delete(data.id);
+ }
+
if (event === 'model_install_complete') {
recordOutcome({
error: null,