Fixed
Status Update
Comments
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #2
Yigit, do you have time to fix it?
reemission of the same liveData is racy
reemission of the same liveData is racy
le...@gmail.com <le...@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.
or...@gmail.com <or...@gmail.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: 2.4.0-beta02
Devices/Android versions reproduced on: Emulator API 23 and 31
Describe the problem:
When navigating to a composable dialog destination, the dialog destination is lost after an orientation change.
Observed Results:
The composable dialog destination is lost after an orientation change
Expected Results:
The composable dialog destination should still be visible after an orientation change
Steps to reproduce:
dialog
Relevant Code:
The composable dialog is defined here:https://github.com/leinardi/Forlago/blob/dialog/modules/feature-foo/src/main/kotlin/com/leinardi/forlago/feature/foo/ui/foodialog/FooDialogScreen.kt#L36
The Dialog destination route is defined here:https://github.com/leinardi/Forlago/blob/dialog/modules/core-navigation/src/main/kotlin/com/leinardi/forlago/core/navigation/destination/foo/FooDialogDestination.kt#L22
The Dialog destinations are added to the NavHost here:https://github.com/leinardi/Forlago/blob/dialog/app/src/main/kotlin/com/leinardi/forlago/ui/MainActivity.kt#L109
Attached there is a short video showing the issue.