From 4534b7a17df33c0d3cc207340945cd8105091e83 Mon Sep 17 00:00:00 2001 From: asepharyana Date: Mon, 31 Aug 2026 15:36:05 +0700 Subject: [PATCH] feat(gateway): log full watch Networking state transitions Add watch-state N->M log on every djs/voice Networking stateChange (with hasUdp flag) so the stream-watch connection's exact progression is visible: OpeningWs(0)->Identifying(1)->UdpHandshaking(2)->SelectingProtocol(3)-> Ready(4). Pins down where the DAVE flow stalls instead of guessing from the absence of logs. Pairs with debug:true + watch-djs-debug. --- .../src/modules/voice-recording/streamWatchReceiver.ts | 7 ++++++- 1 file changed, 6 insertions(+), 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 6172592a..4f9c71b9 100644 --- a/services/discord-gateway/src/modules/voice-recording/streamWatchReceiver.ts +++ b/services/discord-gateway/src/modules/voice-recording/streamWatchReceiver.ts @@ -271,9 +271,14 @@ function connectWatch( handleUdpMessage(watchKey, netAny, uidProps, msg); }; - net.on("stateChange", (newState: unknown) => { + net.on("stateChange", (newState, oldState) => { const s = newState as { code?: number }; const code = s?.code; + const oldCode = (oldState as { code?: number })?.code; + logger.info( + { userId: uid, code, oldCode, hasUdp: !!netAny.state.udp }, + `watch-state ${oldCode}->${code}`, + ); if (code === 4 /* Ready */) { const udp = netAny.state.udp; if (udp) {