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

connect leaks Coroutine on subsequent reconnects (Android) #139

Closed
twyatt opened this issue Jul 12, 2021 · 2 comments
Closed

connect leaks Coroutine on subsequent reconnects (Android) #139

twyatt opened this issue Jul 12, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@twyatt
Copy link
Member

twyatt commented Jul 12, 2021

Characteristic changes are forwarded from the Callback to the Observers via launchIn(scope) but the Coroutine is never cancelled.

connection
.characteristicChanges
.onEach(observers.characteristicChanges::emit)
.launchIn(scope, start = UNDISPATCHED)

@twyatt twyatt self-assigned this Jul 12, 2021
@twyatt twyatt added the bug Something isn't working label Jul 12, 2021
@twyatt
Copy link
Member Author

twyatt commented Nov 22, 2021

I may have misunderstood or overlooked that upstream the Channel is closed, and thus: this launched Coroutine should terminate when the upstream Channel closes (which is triggered via a disconnect event in the Android Callback).

tl;dr this may not be a bug (it might not leak) at all.

@twyatt
Copy link
Member Author

twyatt commented Dec 5, 2021

Confirmed that this is not a bug. In #193, the completion of the flow identified in this issue is relied on for observation handling. Testing of SNAPSHOTs produced from #193 confirmed that (as identified in #139 (comment)), the flow is terminated upon disconnected signal in Android's BluetoothGattCallback.

@twyatt twyatt closed this as completed Dec 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant