Skip to content

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

Merged
philips77 merged 1 commit into
masterfrom
bugfix/race-condition-on-remove-bond
Mar 18, 2022
Merged

Making sure then() callback is called for RemoveBond request#365
philips77 merged 1 commit into
masterfrom
bugfix/race-condition-on-remove-bond

Conversation

@philips77

@philips77 philips77 commented Mar 16, 2022

Copy link
Copy Markdown
Contributor

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