From 90289fede1866657c2774de9b151e12a9212bafd Mon Sep 17 00:00:00 2001 From: hobokenchicken Date: Mon, 29 Jun 2026 14:24:45 -0400 Subject: [PATCH] sync: all server-side fixes and features --- web/src/stores/ws.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/web/src/stores/ws.ts b/web/src/stores/ws.ts index 5f1974d..adb27b0 100644 --- a/web/src/stores/ws.ts +++ b/web/src/stores/ws.ts @@ -49,11 +49,11 @@ function extractServer(payload: UnknownPayload): Server | null { return payload.server as unknown as Server; } -function extractIds(payload: UnknownPayload): { channelId: string; messageId: string } | null { +function extractIds(payload: UnknownPayload): { channel_id: string; message_id: string } | null { if (typeof payload.channel_id !== 'string' || typeof payload.message_id !== 'string') { return null; } - return { channelId: payload.channel_id, messageId: payload.message_id }; + return { channel_id: payload.channel_id, message_id: payload.message_id }; } function extractChannelId(payload: UnknownPayload): string | null { @@ -89,8 +89,6 @@ export const useWebSocketStore = create((set, get) => ({ }; socket.onopen = () => { - // Send auth token as the first message frame instead of a URL param. - // This keeps the token out of server logs, browser history, and Referer headers. socket.send(JSON.stringify({ token })); }; @@ -102,7 +100,6 @@ export const useWebSocketStore = create((set, get) => ({ return; } - // Server sends {"type":"ready"} after successful auth. if (data.type === 'ready') { set({ connected: true }); reconnectDelay = 1000; @@ -110,7 +107,6 @@ export const useWebSocketStore = create((set, get) => ({ } if (data.type === 'error') { - // Auth failed or server sent an error. Close and don't reconnect. console.error('ws error:', data); socket.close(); return;