Fixed
Status Update
Comments
il...@google.com <il...@google.com>
al...@gmail.com <al...@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
cl...@google.com <cl...@google.com>
ap...@google.com <ap...@google.com> #3
yea i'll take it.
cl...@google.com <cl...@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.
na...@google.com <na...@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()
}
}
Description
Component used: Navigation
Version used: androidx.navigation:navigation-compose:2.7.0-rc01 (same issue occurs with 2.6.0)
Devices/Android versions reproduced on: Pixel 6 / Android 13
Calling
NavController.navigate() { launchSingleTop = true }
when using two nested navigations graphs that both contain a node with the same nested route crashes with this stack trace:I have attached a sample project, here's the interesting part of it: