Fixed
Status Update
Comments
fo...@gmail.com <fo...@gmail.com> #2
Yigit, do you have time to fix it?
reemission of the same liveData is racy
reemission of the same liveData is racy
jb...@google.com <jb...@google.com>
th...@outlook.com <th...@outlook.com> #3
yea i'll take it.
pa...@gmail.com <pa...@gmail.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.
il...@google.com <il...@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()
}
}
il...@google.com <il...@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
Component used: Fragment, Navigation
Version used: Fragment 1.7.0, Navigation 2.7.7
Devices/Android versions reproduced on: Poco F5, Android 14
Screen recording demonstrating the issue and sample project are attached. Predictive back gesture is enabled.
Steps to reproduce: Navigate to another tab. Perform the back gesture and cancel it. Navigate to another tab.
Exception: