chrvadala / node-ble

Bluetooth Low Energy (BLE) library written with pure Node.js (no bindings) - baked by Bluez via DBus
https://www.npmjs.com/package/node-ble
MIT License
320 stars 47 forks source link

Device dbus "match" leak #36

Closed tuxedoxt closed 9 months ago

tuxedoxt commented 2 years ago

Hello,

using Device.getDevice repeatedly causes registered dbus "matches" to accumulate. I traced it until that _removeMatch (dbus-next) triggers on event listener removal but doesn't really send the RemoveMatch message. Now not sure if this is a bug of this library or of dbus-next or if there's a version solving it.

This is one of two issues I noticed while repeatedly trying to enumerate a devices and read some properties from them (in a heavy BLE traffic area).

ChocolateLoverRaj commented 2 years ago

I got an error because of this leak. I started discovery and called getDevices() every second. After a few seconds I got this error:

DBusError: Connection ":1.45" is not allowed to add more match rules (increase limits in configuration file if required; max_match_rules_per_connection=512)
ChocolateLoverRaj commented 2 years ago

Device.getDevice

Do you mean Adapter.getDevice?