From eb973e0f83a8cce7014950014b329764edd94da4 Mon Sep 17 00:00:00 2001 From: James Murdza Date: Fri, 25 Oct 2024 19:02:18 -0600 Subject: [PATCH] fix: call handlers without callbacks --- backend/server/src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/server/src/index.ts b/backend/server/src/index.ts index 546e3a4..f3af14a 100644 --- a/backend/server/src/index.ts +++ b/backend/server/src/index.ts @@ -124,7 +124,8 @@ io.on("connection", async (socket) => { Object.entries(sandboxManager.handlers()).forEach(([event, handler]) => { socket.on(event, async (options: any, callback?: (response: any) => void) => { try { - callback?.(await handler(options)); + const result = await handler(options) + callback?.(result); } catch (e: any) { handleErrors(`Error processing event "${event}":`, e, socket); }