authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-02-27 18:02:09-08:00
committergravatar for jmarminge@gmail.comJulius Marminge <jmarminge@gmail.com> 2026-02-27 18:08:18-08:00
log21c823ecdc63ebfae0226f174f639191a971cd85
tree623e0cd51ac562eb4251e9225b1721629454e107
parent80498f1709e05caa744716b740fdcaa884bef8e0

Guard delayed terminal exit callback

- Skip `onSessionExited` if exit handling was reset before timeout runs - Prevent stale async exit callbacks from firing in terminal drawer

1 files changed, 3 insertions(+), 0 deletions(-)

apps/web/src/components/ThreadTerminalDrawer.tsx+3
...@@ -349,6 +349,9 @@ function TerminalViewport({...@@ -349,6 +349,9 @@ function TerminalViewport({
349 }349 }
350 hasHandledExitRef.current = true;350 hasHandledExitRef.current = true;
351 window.setTimeout(() => {351 window.setTimeout(() => {
352 if (!hasHandledExitRef.current) {
353 return;
354 }
352 onSessionExitedRef.current();355 onSessionExitedRef.current();
353 }, 0);356 }, 0);
354 }357 }