fix(workflows): unregister missing yaml on trash
Ghost register entries returned 404 on delete and stayed in the list. Unregister first so move-to-trash still removes them when the file is gone. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -136,6 +136,18 @@ const warnings = collectWorkflowWarnings(
|
||||
);
|
||||
assert.ok(warnings.warnings.some((w) => w.code === "unknown_script"));
|
||||
|
||||
const ghostFile = newWorkflowFilename();
|
||||
fsStore.writeRegisters(owner, [file, ghostFile]);
|
||||
const ghostTrash = await moveWorkflowToTrash({
|
||||
workflowId: workflowIdFromFile(ghostFile),
|
||||
owner,
|
||||
file: ghostFile,
|
||||
name: null,
|
||||
});
|
||||
assert.equal(ghostTrash, null);
|
||||
assert.ok(!fsStore.readRegisters(owner).includes(ghostFile));
|
||||
assert.ok(fsStore.readRegisters(owner).includes(file));
|
||||
|
||||
const trashed = await moveWorkflowToTrash({
|
||||
workflowId,
|
||||
owner,
|
||||
|
||||
Reference in New Issue
Block a user