fix(FN-1952): preserve explicit non-cleanup archive

This commit is contained in:
gsxdsm
2026-04-16 19:56:28 -07:00
parent 48e79cd46d
commit cc7f7bd6f8
2 changed files with 17 additions and 12 deletions

View File

@@ -2950,14 +2950,19 @@ export class TaskStore extends EventEmitter<TaskStoreEvents> {
action: "Task archived",
});
if (cleanup) {
const cleanedBranches = await this.cleanupBranchForTask(task);
if (cleanedBranches.length > 0) {
task.log.push({
timestamp: new Date().toISOString(),
action: `Cleaned up branch: ${cleanedBranches.join(", ")}`,
});
}
if (!cleanup) {
await this.atomicWriteTaskJson(dir, task);
if (this.isWatching) this.taskCache.set(id, { ...task });
this.emit("task:moved", { task, from: "done" as Column, to: "archived" as Column });
return task;
}
const cleanedBranches = await this.cleanupBranchForTask(task);
if (cleanedBranches.length > 0) {
task.log.push({
timestamp: new Date().toISOString(),
action: `Cleaned up branch: ${cleanedBranches.join(", ")}`,
});
}
const entry = await this.taskToArchiveEntry(task, task.columnMovedAt);