From c078621935bec6529f561242487061cb5bfef078 Mon Sep 17 00:00:00 2001 From: jaydenfyi <213395523+jaydenfyi@users.noreply.github.com> Date: Mon, 26 Jan 2026 00:29:33 +0800 Subject: [PATCH] make twitch message processing non blocking --- extensions/twitch/src/monitor.ts | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/extensions/twitch/src/monitor.ts b/extensions/twitch/src/monitor.ts index 34a61caa1..f229a24cf 100644 --- a/extensions/twitch/src/monitor.ts +++ b/extensions/twitch/src/monitor.ts @@ -206,7 +206,7 @@ export async function monitorTwitchProvider( throw error; } - const unregisterHandler = clientManager.onMessage(account, async (message) => { + const unregisterHandler = clientManager.onMessage(account, (message) => { if (stopped) return; // Access control check @@ -228,19 +228,18 @@ export async function monitorTwitchProvider( statusSink?.({ lastInboundAt: Date.now() }); - try { - await processTwitchMessage({ - message, - account, - accountId, - config, - runtime, - core, - statusSink, - }); - } catch (err) { + // Fire-and-forget: process message without blocking + void processTwitchMessage({ + message, + account, + accountId, + config, + runtime, + core, + statusSink, + }).catch((err) => { runtime.error?.(`Message processing failed: ${String(err)}`); - } + }); }); const stop = () => {