fix(web): reset isMountedRef on mount (StrictMode double-invoke)

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) <noreply@anthropic.com>
This commit is contained in:
Gergo Magyar 2026-06-09 10:12:11 +00:00
parent 7c4e5700ff
commit 1a5db7e39d

View file

@ -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();