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:
2026-08-23 09:17:10 +07:00
co-authored by Cursor
parent dd98421b08
commit e2e70a5aad
3 changed files with 45 additions and 14 deletions
@@ -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,