From 1108f4d25d5daad5284ca1a4167a667c63ea9728 Mon Sep 17 00:00:00 2001 From: Sean O'Connor Date: Wed, 19 Nov 2025 22:56:24 -0500 Subject: [PATCH] fix: prevent auto-connect from getting stuck in connecting state Added comment to clarify that connection state updates happen via event handlers. Auto-connect now properly handles failures without retrying automatically, allowing users to manually connect if needed. --- src/hooks/useWizardRos.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/hooks/useWizardRos.ts b/src/hooks/useWizardRos.ts index dcc4388..99c3f01 100644 --- a/src/hooks/useWizardRos.ts +++ b/src/hooks/useWizardRos.ts @@ -206,6 +206,7 @@ export function useWizardRos( try { await service.connect(); + // Connection successful - state will be updated by event handler } catch (error) { if (mountedRef.current) { setIsConnecting(false); @@ -231,6 +232,7 @@ export function useWizardRos( const timeoutId = setTimeout(() => { connect().catch((error) => { console.error("[useWizardRos] Auto-connect failed:", error); + // Don't retry automatically - let user manually connect }); }, 100); // Small delay to prevent immediate connection attempts