Fixed
Status Update
Comments
il...@google.com <il...@google.com>
jo...@jmb.dev <jo...@jmb.dev> #2
Yigit, do you have time to fix it?
reemission of the same liveData is racy
reemission of the same liveData is racy
il...@google.com <il...@google.com> #3
yea i'll take it.
ap...@google.com <ap...@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.
jb...@google.com <jb...@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()
}
}
an...@google.com <an...@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.2.0-rc04
Devices/Android versions reproduced on: potentially all
This is kind of a followup to
There seems to be a bug related to the changes introduced in the aforementioned ticket. If I define a simple deeplink like so:
<deepLink
android:id="@+id/deepLinkToSomething"
app:uri="myapp://open/something />
... the deeplink will NOT be executed when I attempt to open an Intent which has the data URI myapp://open/something?someParameter=parameter. The solution to the aforementioned ticket should have made this work by ignoring undefined parameters.
My current local solution (as outlined per
<deepLink
android:id="@+id/deepLinkToSomething"
app:uri="myapp://open/something?dummy={dummy} />
Then it works just fine.
I suspect it has something to do with how the pattern is compiled in the constructor of NavDeepLink in case there are no parameters.