diff --git a/apps/web/src/pages/Connections/useConnections.ts b/apps/web/src/pages/Connections/useConnections.ts index 4c7ae1930..58d04f967 100644 --- a/apps/web/src/pages/Connections/useConnections.ts +++ b/apps/web/src/pages/Connections/useConnections.ts @@ -88,7 +88,13 @@ export function useConnections() { if (conn?.meshDeviceId) { try { useDeviceStore.getState().removeDevice(conn.meshDeviceId); - } catch {} + } catch (err) { + log.warn("removeDevice failed during removeConnection", { + id, + meshDeviceId: conn.meshDeviceId, + err, + }); + } } meshRegistry.unregister(id); removeSavedConnectionFromStore(id); @@ -249,7 +255,9 @@ export function useConnections() { // Read from the live store, not the memoized `connections` closure: callers // such as addConnectionAndConnect() add a connection and connect to it in the // same tick, before this hook re-renders, so the closure would be stale. - const conn = useDeviceStore.getState().savedConnections.find((c) => c.id === id); + const conn = useDeviceStore + .getState() + .savedConnections.find((c) => c.id === id); if (!conn) { log.warn("connect: unknown connection id", { id }); return false;