Skip to content

Commit 545ed92

Browse files
committed
Remove debug logging from BLE connection fix
User confirmed BLE connection is working correctly after the byte counter fix, but reported slower performance compared to 8.0.1. Analysis showed 4 console.log() statements in the data path: - 2 logs on every BLE notification received (hot path) - 2 logs during listener add/remove (cold path) The hot path logs were causing performance degradation as they execute on every 20-byte BLE packet received. Removed all 4 debug logs as they were marked TODO for removal after testing. The core fix (using _onReceiveListeners array) remains intact.
1 parent 3742221 commit 545ed92

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

js/connection/connectionBle.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,9 @@ class ConnectionBle extends Connection {
170170
data: buffer
171171
};
172172

173-
// TODO: Remove debug logging after BLE fix is verified in testing
174-
console.log(`[BLE FIX] ← Received ${buffer.byteLength} bytes, ${this._onReceiveListeners.length} listener(s), counter at ${this._bytesReceived}`);
175-
176173
this._onReceiveListeners.forEach(listener => {
177174
listener(info);
178175
});
179-
180-
console.log(`[BLE FIX] Byte counter after dispatch: ${this._bytesReceived}`);
181176
};
182177

183178
this._readCharacteristic.addEventListener('characteristicvaluechanged', this._handleOnCharateristicValueChanged)
@@ -248,15 +243,11 @@ class ConnectionBle extends Connection {
248243
}
249244

250245
addOnReceiveCallback(callback){
251-
// TODO: Remove debug logging after BLE fix is verified in testing
252-
console.log(`[BLE FIX] addOnReceiveCallback: listener count ${this._onReceiveListeners.length}${this._onReceiveListeners.length + 1}`);
253246
this._onReceiveListeners.push(callback);
254247
}
255248

256249
removeOnReceiveCallback(callback){
257250
this._onReceiveListeners = this._onReceiveListeners.filter(listener => listener !== callback);
258-
// TODO: Remove debug logging after BLE fix is verified in testing
259-
console.log(`[BLE FIX] removeOnReceiveCallback: listener count now ${this._onReceiveListeners.length}`);
260251
}
261252

262253
addOnReceiveErrorCallback(callback) {

0 commit comments

Comments
 (0)