authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-03-02 13:32:27-08:00
committergravatar for jmarminge@gmail.comJulius Marminge <jmarminge@gmail.com> 2026-03-02 13:49:04-08:00
logc530e5d50f5a77cd732c0c3e09d9ef964faea96e
tree6babde028dc19cdcb6ef939b63faed2b2e0c9b1b
parent674720c6cd233ca8c9a7b357eb954e26cae3466d

Guard commitRename cleanup against concurrent renames

After the async dispatch, only clear renamingThreadId if it still matches the thread being renamed, preventing a second rename's input from being cleared by the first's completion. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

1 files changed, 5 insertions(+), 1 deletions(-)

apps/web/src/components/Sidebar.tsx+5-1
...@@ -543,7 +543,11 @@ export default function Sidebar() {...@@ -543,7 +543,11 @@ export default function Sidebar() {
543 description: error instanceof Error ? error.message : "An error occurred.",543 description: error instanceof Error ? error.message : "An error occurred.",
544 });544 });
545 }545 }
546 cancelRename();546 setRenamingThreadId((current) => {
547 if (current !== threadId) return current;
548 renamingInputRef.current = null;
549 return null;
550 });
547 },551 },
548 [cancelRename],552 [cancelRename],
549 );553 );