Skip to content

Connecting multiple times to a LE device is working correctly again#884

Merged
zxzxwu merged 2 commits intogoogle:mainfrom
timrid:fix-multiple-le-connections
Feb 6, 2026
Merged

Connecting multiple times to a LE device is working correctly again#884
zxzxwu merged 2 commits intogoogle:mainfrom
timrid:fix-multiple-le-connections

Conversation

@timrid
Copy link
Contributor

@timrid timrid commented Feb 5, 2026

Once you have disconnected from an LE device, it was not possible to reconnect because the connection was not removed from le_connections.

In my test, I got the following error message:

ERROR    bumble.controller:controller.py:615 Connection for D4:8C:53:05:47:DC already exists?

This is now fixed. This was still possible in v0.0.220, but this regression was added in #827.

else:
# Remove the connection
del self.classic_connections[connection.peer_address]
del self.le_connections[connection.peer_address]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look correct, though I am not sure why link can be None, but it will accidentually drop the connection on the other transport. Maybe we should split if connection := self.find_connection_by_handle(handle): to handle the case find in classic or LE.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know either when link can be None. In any case, this is not covered by the unit tests and is not really relevant to me. But it looked wrong to me, so I corrected it.

However, you are right that it still looks wrong. That's why I split it up as recommended.

@timrid timrid requested a review from zxzxwu February 5, 2026 17:54
@timrid timrid force-pushed the fix-multiple-le-connections branch from 2523b35 to 81d9adb Compare February 5, 2026 19:51
@zxzxwu zxzxwu merged commit d810d93 into google:main Feb 6, 2026
55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants