From 1a5db7e39d7b3004bee51955f6a0c31560edf6de Mon Sep 17 00:00:00 2001 From: Gergo Magyar Date: Tue, 9 Jun 2026 10:12:11 +0000 Subject: [PATCH] fix(web): reset isMountedRef on mount (StrictMode double-invoke) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The mount effect set isMountedRef=false on cleanup but never back to true on re-mount, so under React StrictMode's mount->unmount->mount the ref stayed false for the component's lifetime — trackJob then always early-returned and the upload never advanced past 'starting' (caught by the folder-upload e2e). Set it true at the start of the effect. Co-Authored-By: Claude Opus 4.8 (1M context) --- gitnexus-web/src/components/RepoAnalyzer.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gitnexus-web/src/components/RepoAnalyzer.tsx b/gitnexus-web/src/components/RepoAnalyzer.tsx index 0e4a55d90..25ccfb117 100644 --- a/gitnexus-web/src/components/RepoAnalyzer.tsx +++ b/gitnexus-web/src/components/RepoAnalyzer.tsx @@ -191,6 +191,9 @@ export const RepoAnalyzer = ({ variant, onComplete, onCancel }: RepoAnalyzerProp const isMountedRef = useRef(true); useEffect(() => { + // Set true on every mount (not just the initial ref value) so the guard is + // correct under React StrictMode's mount→unmount→mount double-invoke. + isMountedRef.current = true; return () => { isMountedRef.current = false; sseControllerRef.current?.abort();