Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making sure then() callback is called for RemoveBond request #365

Merged
merged 1 commit into from Mar 18, 2022

Conversation

philips77
Copy link
Member

@philips77 philips77 commented Mar 16, 2022

This PR fixes #363.

Issue

When removeBond() is executed, there are 2 callbacks called in result: disconnection and changing bond state to BOND_NONE. They, however, as shown in #363, can come in any order. Until now, the behaviour was different in any of those cases.

Solution

This PR fixes the issue by ensuring that both the onConnectionStateChange callback and bond state broadcast listener are called. They still can be called in any order, but neither of them should block execution of the other. The then callback of the Remove Bond callback should be called in any case.

@philips77 philips77 force-pushed the bugfix/race-condition-on-remove-bond branch from 540877d to ef22b9e Compare March 16, 2022 13:44
@philips77 philips77 merged commit 3d8ed63 into master Mar 18, 2022
@philips77 philips77 deleted the bugfix/race-condition-on-remove-bond branch March 18, 2022 13:55
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.

cannot receive connection state change after removeBond() sometimes
2 participants