From 68fd1d01b4bc1708f81b89748fb1bf3187c6b653 Mon Sep 17 00:00:00 2001 From: jwcrystal <121911854+jwcrystal@users.noreply.github.com> Date: Tue, 21 Apr 2026 23:00:48 +0800 Subject: [PATCH] fix: invalidate worktree list cache after create and remove (#973) * fix: invalidate worktree list cache after create and remove After creating or removing a worktree, the list cache was not cleared, so the UI would show stale data for up to 30 seconds. * fix: normalize cache key in removeProjectWorktree Greptile review caught that project.path was used raw while the cache stores normalizePath(project.path), so the delete could silently miss on paths with trailing slashes or backslashes. --- packages/ui/src/lib/worktrees/worktreeManager.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/ui/src/lib/worktrees/worktreeManager.ts b/packages/ui/src/lib/worktrees/worktreeManager.ts index 4999d1eb..e33126e1 100644 --- a/packages/ui/src/lib/worktrees/worktreeManager.ts +++ b/packages/ui/src/lib/worktrees/worktreeManager.ts @@ -246,7 +246,6 @@ export async function listProjectWorktrees(project: ProjectRef): Promise undefined);