fix(undo): use invalidateAllCaches to prevent stale state after undo (#556)
After deleting summary files and modifying PLAN files, only invalidateStateCache() was called. Path and parse caches remained stale, causing deriveState() to return incorrect results — showing undone tasks as still complete.
This commit is contained in:
parent
ecef348a95
commit
6f6ef16ee9
1 changed files with 3 additions and 2 deletions
|
|
@ -6,7 +6,8 @@ import type { ExtensionCommandContext, ExtensionAPI } from "@gsd/pi-coding-agent
|
|||
import { existsSync, readFileSync, writeFileSync, unlinkSync, readdirSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import { execFileSync } from "node:child_process";
|
||||
import { deriveState, invalidateStateCache } from "./state.js";
|
||||
import { deriveState } from "./state.js";
|
||||
import { invalidateAllCaches } from "./cache.js";
|
||||
import { gsdRoot, resolveTasksDir, resolveSlicePath, buildTaskFileName } from "./paths.js";
|
||||
import { sendDesktopNotification } from "./notifications.js";
|
||||
|
||||
|
|
@ -118,7 +119,7 @@ export async function handleUndo(args: string, ctx: ExtensionCommandContext, _pi
|
|||
}
|
||||
|
||||
// 6. Re-derive state
|
||||
invalidateStateCache();
|
||||
invalidateAllCaches();
|
||||
await deriveState(basePath);
|
||||
|
||||
// Build result message
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue