From 92f3e6378f87755f0e29f225e9906debae48e842 Mon Sep 17 00:00:00 2001 From: sergystepanov Date: Mon, 1 Jun 2026 13:56:17 +0300 Subject: [PATCH] Update WebRTC module state logging --- web/js/network/webrtc.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/web/js/network/webrtc.js b/web/js/network/webrtc.js index 1f9e793a..1b677e69 100644 --- a/web/js/network/webrtc.js +++ b/web/js/network/webrtc.js @@ -36,26 +36,26 @@ const ice = (() => { log.debug('[rtc] ice candidate error', event) }, onIceStateChange: event => { + const t = event.target; + log.debug(`[rtc] ICE state: ${t.iceGatheringState}`) + switch (event.target.iceGatheringState) { case 'gathering': - log.debug('[rtc] ice gathering'); timeForIceGathering = setTimeout(() => { log.warn(`[rtc] ice gathering was aborted due to timeout ${ICE_TIMEOUT}ms`); // sendCandidates(); }, ICE_TIMEOUT); break; case 'complete': - log.debug('[rtc] ice gathering has been completed'); if (timeForIceGathering) { clearTimeout(timeForIceGathering); } } }, onIceConnectionStateChange: () => { - log.debug('[rtc] <- iceConnectionState', connection.iceConnectionState); + log.debug(`[rtc] ICE connection state: ${connection.iceConnectionState}`); switch (connection.iceConnectionState) { case 'connected': - log.info('[rtc] connected...'); connected = true; break; case 'disconnected': @@ -120,7 +120,7 @@ export const webrtc = { connection.onicecandidate = ice.onIceCandidate; connection.onicecandidateerror = ice.onIceCandidateError; connection.onconnectionstatechange = _ => { - console.debug(`[rtc] connection state -> ${connection.connectionState}`) + console.debug(`[rtc] connection state: ${connection.connectionState}`) } connection.ontrack = event => { mediaStream.addTrack(event.track);