Fixed
Status Update
Comments
il...@google.com <il...@google.com>
il...@google.com <il...@google.com>
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
[Deleted User] <[Deleted User]> #3
yea i'll take it.
dj...@gmail.com <dj...@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.
ar...@gmail.com <ar...@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()
}
}
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
Version used: 1.0.0-alpha01
Devices/Android versions reproduced on: Pixel w Oreo
Two issues for the price of one!
According to the documentation, "When a user uses the Back button from a deep link destination, they navigate back up the navigation stack just as though they entered your app from the app’s entry point." (
I have a navigation graph which looks like [Home] -> [Articles List] -> [Specific Article]
I have a deeplink to [Specific Article]
<deepLink app:uri="
However when the app is opened via deeplink (adb shell am start -W -a android.intent.action.VIEW -d "
Following advice here (
[Home] -> Group([Articles List] -> [Specific Article])
However now deeplinking does not link to [Specific Article] at all! The app opens on [Articles List] with [Home] in the backstack.
I would expect either implementation to behave as per documentation, with the app deep linking to [Specific Article] with both [Articles List] and [Home] in the backstack.
--- Sample project ---
Attached is a sample project demonstrating both issues.
The nav graph is as follows:
[Home] -> [Article List] -> [Article (has deep link)]
\---> Group([Issue List] -> [Issue (has deep link)])
To deep link use the following commands.
Deep link to article:
adb shell am start -W -a android.intent.action.VIEW -d "
Deep link to issue inside group:
adb shell am start -W -a android.intent.action.VIEW -d "