feat(studio): recover matching Nitro sources and persist import phases

This commit is contained in:
2026-09-11 10:22:06 +02:00
parent 00e33623f7
commit 13bd3695cb
45 changed files with 903 additions and 28 deletions
+14 -1
View File
@@ -221,7 +221,7 @@ it("does not save a translated outcome after ownership is lost during translatio
});
await drainFurnitureImports();
expect(mocks.translate).toHaveBeenCalledOnce();
expect(snapshots).toHaveLength(2);
expect(snapshots).toHaveLength(3);
expect(snapshots.at(-1)?.items[0].state).toBe("running");
expect(mocks.updateCatalog).not.toHaveBeenCalled();
});
@@ -249,3 +249,16 @@ it("keeps successful imports complete if their audit write fails", async () => {
expect(job.items[0].state).toBe("done");
expect(job.items[0].warnings).toContain("Audit record could not be saved");
});
it("persists progress before continuing an import and retains the failed phase", async () => {
mocks.import.mockImplementationOnce(async (params) => {
await params.onProgress("downloading");
expect(job.items[0].phase).toBe("downloading");
expect(mocks.save).toHaveBeenCalled();
await params.onProgress("converting");
throw Error("Conversion failed");
});
await drainFurnitureImports();
expect(job.items[0]).toMatchObject({ state: "failed", phase: "converting" });
expect(job.items[0].phaseStartedAt).toBeTruthy();
});