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.

Issue with conflate() operator in bindings

See original GitHub issue

I use the events() binding in my application. More precisely I use it to listen for view lifecycle events in a Fragment like viewLifecycleOwner.lifecycle.events().

However the ON_START event is swallowed for some reason. For example I do receive ON_CREATE and ON_RESUME but not ON_START. It seems like this is a race conditions as ON_START does occur depending of where/when I listen for these events.

I noticed that you apply a conflate() on the Flow. I copied the code of events() and just removed conflate(). With my version I receive ON_START all the time. So I wonder why do you apply conflate()? It seems you add this to all bindings? Is there a specific reason?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ychescale9commented, Mar 14, 2020

Released in 0.10.2.

1reaction
ychescale9commented, Mar 13, 2020

I wonder if there is a Lifecycle concept that only notifies about events from the time events are observed, not replaying previous events?

Not that I’m aware of 🤷‍♂. Anyway I’ll remove conflate() to respect the behavior of LifecycleObserver.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Flow.takeUntil(otherFlow) #1850 - Kotlin/kotlinx.coroutines
I need analog for rxJava takeUntil operator. This logic can be found here Will such an operator be added to the standard library?...
Read more >
A safer way to collect flows from Android UIs - Manuel Vivo .dev
A cold flow backed by a channel or using operators with buffers such as buffer , conflate , flowOn , or shareIn is...
Read more >
conflate - Kotlin
Conflates flow emissions via conflated channel and runs collector in a separate coroutine. The effect of this is that emitter is never suspended...
Read more >
A safer way to collect flows from Android UIs | by Manuel Vivo
A cold flow backed by a channel or using operators with buffers such as buffer , conflate , flowOn , or shareIn is...
Read more >
A pattern matcher for miniKanren or How to get into trouble with CPS ...
CPS macro, binding is delayed until after the comparisons are performed. This may cause free identifiers that are symbolically equal to be conflated, ......
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