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

Bug fix: suspend extension function remains suspended if the request is cancelled #574

Merged

Conversation

muscardinus
Copy link
Contributor

The suspend() extension functions on various Request types will ignore the cancellation instead of throwing an exception when cancelled via a mechanism other then cancelling the coroutine.

In such cases the code that calls suspend() will remain suspended indefinitely.

An example of this is:
Call connect from one coroutine (from within a BleManager):

connect(bluetoothDevice)
    .suspend()

While the connect is in progress (within 30 seconds) and before it could succeed, call from another place in the code:

cancelQueue()

While the connection gets cancelled, the first call will remain suspended.

This PR is an attempt to fix the problem.

@philips77 philips77 merged commit 3815e66 into NordicSemiconductor:main Aug 16, 2024
1 check passed
@muscardinus muscardinus deleted the fix-cancellation-in-suspend branch August 19, 2024 08:00
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