From 8528f2c73d2b581ece92190c26446740972eceed Mon Sep 17 00:00:00 2001 From: asepharyana Date: Mon, 3 Aug 2026 08:19:05 +0700 Subject: [PATCH] =?UTF-8?q?fix(voice):=20screen=20share=20join=20timeout?= =?UTF-8?q?=20=E2=80=94=20Streamer=20join=20hangs=20with=20dual=20voice=20?= =?UTF-8?q?conn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../voice-recording/screenShareController.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/services/discord-gateway/src/modules/voice-recording/screenShareController.ts b/services/discord-gateway/src/modules/voice-recording/screenShareController.ts index 54fadb5..992bca4 100644 --- a/services/discord-gateway/src/modules/voice-recording/screenShareController.ts +++ b/services/discord-gateway/src/modules/voice-recording/screenShareController.ts @@ -74,7 +74,20 @@ export class ScreenShareController { `Voice channel ${status.activeChannelId} not found for screen share`, ); } - await this.streamer.joinVoiceChannel(channel); + await Promise.race([ + this.streamer.joinVoiceChannel(channel), + new Promise((_, reject) => + setTimeout( + () => + reject( + new Error( + "Timed out joining voice channel for screen share (2 koneksi voice bertabrakan?)", + ), + ), + 15000, + ), + ), + ]); const { command, output } = prepareStream(directUrl, { encoder: Encoders.software({ x264: { preset: "superfast" } }),