From 4405647b33ed2c9ddfd85b48877e077562480de6 Mon Sep 17 00:00:00 2001 From: asepharyana Date: Mon, 31 Aug 2026 15:42:12 +0700 Subject: [PATCH] fix(gateway): swap stateChange arg order so Ready actually attaches UDP djs/voice Networking emits stateChange(oldState, newState), but the watch handler declared (newState, oldState) -- reversed. So the code-4 Ready branch (which attaches udp.on('message') + logs 'DAVE watch READY') never fired when entering Ready; it only fired spuriously when LEAVING Ready. Result: full DAVE handshake completed on the watch RTC (Ready + DAVE MLA + video stream 21029 active 1920x1080@60) but no UDP listener -> no video captured. Swap to (oldState, newState) so enter-Ready wires the socket. --- .../src/modules/voice-recording/streamWatchReceiver.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/discord-gateway/src/modules/voice-recording/streamWatchReceiver.ts b/services/discord-gateway/src/modules/voice-recording/streamWatchReceiver.ts index 4f9c71b9..363c4e55 100644 --- a/services/discord-gateway/src/modules/voice-recording/streamWatchReceiver.ts +++ b/services/discord-gateway/src/modules/voice-recording/streamWatchReceiver.ts @@ -271,7 +271,7 @@ function connectWatch( handleUdpMessage(watchKey, netAny, uidProps, msg); }; - net.on("stateChange", (newState, oldState) => { + net.on("stateChange", (oldState, newState) => { const s = newState as { code?: number }; const code = s?.code; const oldCode = (oldState as { code?: number })?.code;