From b929ed42033e3de9813ceba92b055a0afe473160 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 14 Jul 2026 01:59:53 +0000 Subject: [PATCH 1/2] Initial plan From 8158b5e10b3aaad86151e6c5ca02c461e34a7341 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 14 Jul 2026 02:03:22 +0000 Subject: [PATCH 2/2] fix: log removeDevice failures with structured error fields Apply reviewer feedback from PR #1283 review: - Log err.name and err.message instead of raw err object to avoid {} serialization in JSON-based loggers, consistent with teardown() and connect() error handling patterns in the same file - Reformat long chained call in connect() for readability --- apps/web/src/pages/Connections/useConnections.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/apps/web/src/pages/Connections/useConnections.ts b/apps/web/src/pages/Connections/useConnections.ts index 4c7ae1930..cae3a4655 100644 --- a/apps/web/src/pages/Connections/useConnections.ts +++ b/apps/web/src/pages/Connections/useConnections.ts @@ -88,7 +88,15 @@ export function useConnections() { if (conn?.meshDeviceId) { try { useDeviceStore.getState().removeDevice(conn.meshDeviceId); - } catch {} + } catch (e) { + const err = e as Error; + log.warn("removeDevice failed during removeConnection", { + id, + meshDeviceId: conn.meshDeviceId, + name: err?.name, + message: err?.message, + }); + } } meshRegistry.unregister(id); removeSavedConnectionFromStore(id); @@ -249,7 +257,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;