Verified
Status Update
Comments
ry...@gmail.com <ry...@gmail.com> #2 Restricted+
Restricted+
Comment has been deleted.
be...@google.com <be...@google.com> #3
yea i'll take it.
mo...@google.com <mo...@google.com> #4
Thanks for the detailed analysis. This may not be an issue anymore since we've started using Main.immediate there but I' not sure; I'll try to create a test case.
be...@google.com <be...@google.com>
ap...@google.com <ap...@google.com> #5
just emitting same live data reproduces the issue.
@Test
fun raceTest() {
val subLiveData = MutableLiveData(1)
val subject = liveData(testScope.coroutineContext) {
emitSource(subLiveData)
emitSource(subLiveData) //crashes
}
subject.addObserver().apply {
testScope.advanceUntilIdle()
}
}
@Test
fun raceTest() {
val subLiveData = MutableLiveData(1)
val subject = liveData(testScope.coroutineContext) {
emitSource(subLiveData)
emitSource(subLiveData) //crashes
}
subject.addObserver().apply {
testScope.advanceUntilIdle()
}
}
ml...@google.com <ml...@google.com>
be...@google.com <be...@google.com>
na...@google.com <na...@google.com> #6
With 2.2.0-alpha04 (that use Main.immediate), the issue seems to be still there (I tested it by calling emitSource() twice, like your test case)
Description
We now have
ReportDrawnWhen
which takes a boolean predicate orReportDrawnAfter
for suspend functions. But for basic cases where we just need to report drawn at a given time aReportDrawn
API would be very helpful.Can we get this in a future alpha before the API is stabilizing?