Skip to content

Commit 038de08

Browse files
authored
fix(vpncontroller): reduce console spam from repeated bridge messages (#272)
1 parent e69c5eb commit 038de08

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/background/vpncontroller/vpncontroller.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,19 @@ export class VPNController extends Component {
168168

169169
// Handle responses from MozillaVPN client
170170
async handleResponse(response) {
171-
console.debug(response);
172171
if (!response.t) {
173172
// The VPN Client always sends a ".t : string"
174173
// to determing the message type.
175174
// If it's not there it's from the bridge.
175+
const oldState = this.#mState.value;
176176
this.handleBridgeResponse(response, this.#mState);
177+
// Only log bridge messages when they actually change state
178+
if (oldState !== this.#mState.value) {
179+
console.debug("Bridge state changed:", response);
180+
}
177181
return;
178182
}
183+
console.debug(response);
179184
switch (response.t) {
180185
case "servers":
181186
if (

0 commit comments

Comments
 (0)