From 4179cba30a864e5f8e07cedc301f64c70c17dfba Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Thu, 29 May 2025 20:27:43 -0700 Subject: [PATCH] Debug Channel logging for 'Unwatch' SFX bug A user reported that they hear the 'Unwatch' sound effect play more often than they should, including when his camera isn't even active. Only the BareRTC unwatch command makes the page play that sound effect, so some debug messages will post in the Debug Log channel to check if I hear the sound effect. --- src/lib/WebRTC.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/WebRTC.js b/src/lib/WebRTC.js index 30c12b4..1c047df 100644 --- a/src/lib/WebRTC.js +++ b/src/lib/WebRTC.js @@ -663,6 +663,12 @@ class WebRTCController { this.playSound("Watch"); }, onUnwatch(msg) { + this.DebugChannel(`BareRTC Unwatch received from: ${msg.username}

` + + `Current watching: ${JSON.stringify(Object.keys(this.webcam.watching))}
` + + `Was in watch list: ${this.webcam.watching[msg.username] == undefined ? 'NO!' : 'YES'}
` + + `My camera is: ${this.webcam.active ? 'active': 'not active'}`, + ); + // The user has closed our video feed. delete (this.webcam.watching[msg.username]); this.playSound("Unwatch");