From d676da4e3525f5f6eed24e4c4113350521fe10bc Mon Sep 17 00:00:00 2001 From: "Molecule AI Dev Engineer A (Kimi)" Date: Thu, 18 Jun 2026 04:10:19 +0000 Subject: [PATCH] fix(chat): log WebSocket message handling errors instead of swallowing (mc#2908 F6) The socket message handler had a bare catch block that silently ignored parse/handling failures. Surface them via console.error so malformed or unexpected payloads fail visibly during debugging and monitoring. Relates-to: #2908 --- canvas/src/components/tabs/chat/hooks/useChatSocket.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/canvas/src/components/tabs/chat/hooks/useChatSocket.ts b/canvas/src/components/tabs/chat/hooks/useChatSocket.ts index e73439f0a..b43a6e0b2 100644 --- a/canvas/src/components/tabs/chat/hooks/useChatSocket.ts +++ b/canvas/src/components/tabs/chat/hooks/useChatSocket.ts @@ -211,8 +211,10 @@ export function useChatSocket( kind: (p.kind as string) || "", }); } - } catch { - /* ignore */ + } catch (err) { + // Don't silently swallow socket message parse/handling errors; + // otherwise malformed payloads fail invisibly (mc#2908 F6). + console.error("useChatSocket: failed to handle WebSocket message", err); } }); } -- 2.52.0