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
310 stars 45 forks source link

Device dbus "match" leak #36

Closed tuxedoxt closed 6 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 1 year 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 1 year ago

Device.getDevice

Do you mean Adapter.getDevice?