Fixed
Status Update
Comments
il...@google.com <il...@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
th...@gmail.com <th...@gmail.com> #3
yea i'll take it.
br...@gmail.com <br...@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()
}
}
jb...@google.com <jb...@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
Version used: 2.1.0-alpha02
Devices/Android versions reproduced on: Pixel 3XL, APi 28
When using an implicit deep link to open an app to a destination that is not the root/home destination, the user experiences a weird "flash" on the device, where it appears to open the app, and then open the app again. See the attached animated gif for a demo of the flash effect.
The attached sample app, QueryString can be used to reproduce the issue. The app contains two destination fragments, RootFragment and ChildFragment. In the navigation graph, RootFragment is the start destination, and contains an action to navigate to ChildFragment. Child Fragment also has a <deeplink> with it's URI set to "
To reproduce the "flash" effect:
1. open, build, and install the sample app on a device or emulator
2. Open the app to make sure it's working
3. Close the app (swipe it away from the recents screen).
3. Open a link to
When you tap on the link in the messages app, you'll see the "flash" of the app opening, and the the app opening again.