Skip to content

Conversation

@wwaaijer
Copy link

Found an issue and a fix for a problem with handling a connection disconnecting when multiple connections are involved.

To reproduce the issue, run a simple Bleno process with DEBUG=*:

  • Connect with device A first
  • Connect with device B second
  • Disconnect device A
  • See the message ignoring event because handle is unknown to bleno.
  • See no disconnect event being triggered

This issue could also lead to congestion problems within pushAclOutQueue(), since this._handleAclsInProgress[handle] will not be cleared. It seems to be simply a leftover from when Bleno only supported a single connection at a time.

Borrowed the this._handleAclsInProgress[handle] === undefined check from the handling of the EVT_NUMBER_OF_COMPLETED_PACKETS event.

Happy to discuss or change anything you like!

@stoprocent
Copy link
Owner

stoprocent commented Dec 24, 2025

Oh that is AWESOME!

@stoprocent stoprocent merged commit 834dd1d into stoprocent:main Dec 24, 2025
15 checks passed
@github-actions
Copy link

🎉 This PR is included in version 0.12.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants