question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cancelling scope of observation prevents restarting observation after creating new scope

See original GitHub issue

As reported on Slack, observation isn’t starting after a previous observation is cancelled (and remote peripheral is powered off and back on). Upon reconnecting, setCharacteristicNotification is not called to enable the observation.

Reproduction steps were said to be:

  1. Observe a characteristic.
  2. Cancel the scope of observation.
  3. Turn off the peripheral (hardware) and turn on it.
  4. Reconnect with the peripheral.
  5. Observe the characteristic again.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
ebabelcommented, Aug 10, 2022

I’ve been running with and without this snapshot for the last 8 days and it definitely seems to fix both the issues described above. Thanks @twyatt for fixing and @francismariano for defining the issue! 🎉

0reactions
twyattcommented, Aug 10, 2022

Thanks for testing/validating the snapshot @ebabel! I’ve taken the PR out of draft.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use Kotlin coroutines with lifecycle-aware components
Any coroutine launched in this scope is canceled when the Lifecycle is destroyed. ... Create a new coroutine in the lifecycleScope
Read more >
Unit test the new Kotlin coroutine StateFlow - Stack Overflow
To solve this issue you need to cancel the scope in which the collect is called, and as the scope of your test...
Read more >
repeatOnLifecycle API design story | by Manuel Vivo - Medium
This API uses the LifecycleOwner 's lifecycleScope to trigger a new coroutine and call repeatOnLifecycle inside it.
Read more >
Common mistakes when using Architecture Components
Don't use Fragment as a LifecycleOwner when observing Live Data. ... asStateFlow() fun fetchMovieData() { viewModelScope.launch ...
Read more >
Kotlin Flows in Android summary - ProAndroidDev
To prevent the flow collection from suspending the current scope, ... collector is to cancel and restart it every time a new value...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found