From 9606187861d6dfe1a7dce14a346144141e438c71 Mon Sep 17 00:00:00 2001 From: asepharyana Date: Mon, 31 Aug 2026 16:47:27 +0700 Subject: [PATCH] feat(gateway): hexdump+ssrc of watch UDP packets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit maxLen stayed 72 across 243 packets (no real H264, which is hundreds+ bytes) — only 44-72-byte RTP packets on PT 76/72/73 arrive. Add ssrc + first-32-bytes hex so we can identify exactly what Discord sends to the watch socket (control packets vs stale video), which determines whether the gap is upstream routing or whether large H264 packets are missing entirely. --- .../modules/voice-recording/streamWatchReceiver.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/services/discord-gateway/src/modules/voice-recording/streamWatchReceiver.ts b/services/discord-gateway/src/modules/voice-recording/streamWatchReceiver.ts index c4a38863..297a6bd8 100644 --- a/services/discord-gateway/src/modules/voice-recording/streamWatchReceiver.ts +++ b/services/discord-gateway/src/modules/voice-recording/streamWatchReceiver.ts @@ -476,9 +476,12 @@ function handleUdpMessage( watch._diag = stat; const diagCount = stat.video; const dueAt = watch._diagNext ?? 0; - if (diagCount <= 3 || now >= dueAt) { + if (diagCount === 1 || now >= dueAt) { watch._diagNext = now + 20_000; const pts = [...stat.pts].join(","); + const ssrc = msg.readUInt32BE(8); + const first = msg[0]; + const flags = msg[1]; logger.info( { userId: uid, @@ -488,9 +491,13 @@ function handleUdpMessage( haveKey, daveAttached: !!dave?.session, daveReady, - watchesSize: watches.size, + ssrc, + firstByte: first, + flagsByte: flags, + seq: msg.readUInt16BE(2), + hex: msg.subarray(0, 32).toString("hex"), }, - `VIDEO-PKT diag video=${stat.video} maxLen=${stat.maxLen} pts=[${pts}] haveKey=${haveKey} dave=${!!dave?.session} ready=${daveReady}`, + `VIDEO-PKT diag video=${stat.video} maxLen=${stat.maxLen} pts=[${pts}] haveKey=${haveKey} dave=${!!dave?.session} ready=${daveReady} ssrc=${ssrc} first=${first} flags=${flags} hex=${msg.subarray(0, 32).toString("hex")}`, ); } const decrypted = decryptVideoPacket(