You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current design of bluetooth_gatt_start_notify returns two callables:
One that the caller must call when the device disconnects
One that the caller must call to unsubscribe from a notification
We should only return one callable and handle cleaning up disconnecting the callback in _on_bluetooth_device_connection_response so callers can't get it wrong and leak a callback
The text was updated successfully, but these errors were encountered:
I think there is also a bug were we can miss a notify because we do not set up the listener before we subscribe so if the device replies with a notify right away we drop it
I need to fix the bug first before refactoring since we need a patch release for that. The refactoring to return a single callable would be a breaking change which requires a major version bump
bdraco
changed the title
Client design makes it too easy leaks bluetooth notify callbacks on disconnect
Client design makes it too easy to leak bluetooth notify callbacks on disconnect
Nov 24, 2023
The current design of
bluetooth_gatt_start_notify
returns two callables:We should only return one callable and handle cleaning up disconnecting the callback in
_on_bluetooth_device_connection_response
so callers can't get it wrong and leak a callbackThe text was updated successfully, but these errors were encountered: