From 45f09d0ab466f2b768048a2f262ed26a1c5b0367 Mon Sep 17 00:00:00 2001 From: ynwd <10122431+ynwd@users.noreply.github.com> Date: Fri, 6 Dec 2024 17:18:11 +0700 Subject: [PATCH] chore: debug broadcastMessage on prod --- modules/socket/mod.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/socket/mod.ts b/modules/socket/mod.ts index 38c596c4..b2321ec0 100644 --- a/modules/socket/mod.ts +++ b/modules/socket/mod.ts @@ -94,13 +94,11 @@ export default function socketModule(s: Fastro) { } }; socket.onclose = async () => { - const c = ctx.stores.get("connected"); - if (!c) return; - const entries = c.entries().toArray(); + const entries = connected.entries().toArray(); for (const key in entries) { const [username, { value: { socket, data } }] = entries[key]; if (socket && socket.readyState !== WebSocket.OPEN) { - c.delete(username); + connected.delete(username); await broadcastConnection({ type: "ping", room: data.room,