From c1f56b00e12784cd908b080482c24c04b3082068 Mon Sep 17 00:00:00 2001 From: Dan Ditomaso Date: Sun, 12 Jul 2026 16:26:43 -0400 Subject: [PATCH] fix(useConnections): log removeDevice failures instead of swallowing Bare catch {} on line 89 hid any failure from the device store's removeDevice call, leaving cleanup partially completed with no signal in the logs. Log at warn level with the connection + device id and the error. Closes #1272 --- apps/web/src/pages/Connections/useConnections.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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;