Fixed
Status Update
Comments
ya...@gmail.com <ya...@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
il...@google.com <il...@google.com>
br...@gmail.com <br...@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.
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()
}
}
Description
Version used: 2.1.0 alpha 05
Deep links with arguments that are enum types are not recognized and parsed unless the casing in the deeplink is an exact match to the enum. This may not be feasible to fix/add, but wanted to bring it up just in case.
consider an example where I have an enum like so
enum class Colors {
RED,
BLUE,
GREEN
}
And a destination with an argument that takes a Colors, and supports a deeplink
<argument
android:name="destColor"
app:argType="com.my.app.Colors"
android:defaultValue="RED" />
<deepLink
app:uri="
The deeplink will only work if the color is correctly cased:
And the following will NOT work:
Granted, paths in URI's are by rule considered to be case-sensitive, so
It would be nice if perhaps when setting up a destination argument of an enum type (or maybe when defining a deep link) we had the option to specify that a deeplink should or should not match based on case-sensitivity. Of course, there's still the challenge of parsing "red" to Colors.RED when processing the deep link arguments.