fix(web): normalize channel IDs to lowercase across stores and WS

This commit is contained in:
2026-07-27 09:05:23 -04:00
parent 4a416427e9
commit 86717a2867
3 changed files with 13 additions and 9 deletions
+3 -2
View File
@@ -61,7 +61,7 @@ function extractIds(payload: UnknownPayload | undefined): { channel_id?: string;
? payload.id
: null;
if (!messageId) return null;
if (typeof payload.channel_id === 'string') return { channel_id: payload.channel_id, message_id: messageId };
if (typeof payload.channel_id === 'string') return { channel_id: payload.channel_id.toLowerCase(), message_id: messageId };
if (typeof payload.conversation_id === 'string') return { conversation_id: payload.conversation_id.toLowerCase(), message_id: messageId };
return null;
}
@@ -150,7 +150,8 @@ export const useWebSocketStore = create<WebSocketState>((set, get) => ({
}
} else {
const msg = payload as unknown as Message;
addMessage(msg);
const normalizedMsg = { ...msg, channel_id: (msg.channel_id || '').toLowerCase() };
addMessage(normalizedMsg);
// Desktop notification
const currentUserId = useAuthStore.getState().user?.id;