feat(studio): recover matching Nitro sources and persist import phases
This commit is contained in:
1 parent
00e33623f7
commit
13bd3695cb
45 files changed
+903
-28
No files matched your search
@@ -242,3 +242,36 @@ it("attaches recovery files only to safe failed items and preserves retry histor
|
||||
s.retry(original.id, 4, { chair: randomUUID() }),
|
||||
).rejects.toThrow("latest retry");
|
||||
});
|
||||
|
||||
it("clears old source provenance and phase when creating a retry", async () => {
|
||||
const s = await store();
|
||||
const original: ImportJob = {
|
||||
...job(),
|
||||
state: "completed",
|
||||
items: [
|
||||
{
|
||||
id: 1,
|
||||
classname: "chair",
|
||||
name: "Chair",
|
||||
description: "",
|
||||
type: "flooritem",
|
||||
revision: 1,
|
||||
category: "other",
|
||||
state: "failed",
|
||||
phase: "converting",
|
||||
phaseStartedAt: new Date().toISOString(),
|
||||
sourceAttempt: "Old source",
|
||||
recoveredSource: {
|
||||
sourceId: "old",
|
||||
sourceName: "Old source",
|
||||
revision: 1,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
await s.create(original);
|
||||
const child = await s.retry(original.id, 4);
|
||||
expect(child?.items[0].phase).toBeUndefined();
|
||||
expect(child?.items[0].recoveredSource).toBeUndefined();
|
||||
expect(child?.items[0].sourceAttempt).toBeUndefined();
|
||||
});
|
||||
Reference in new issue
Block a user