Fixed
Status Update
Comments
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
ni...@gmail.com <ni...@gmail.com> #3
yea i'll take it.
dm...@amersports.com <dm...@amersports.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()
}
}
da...@google.com <da...@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
Version of Android Studio: 3.1.2 and also I tried on canary 16.
I'm using safeargs gradle plugin.
Sometimes when modifying the navigation xml file, I get the following error:
Execution failed for task ':app:generateSafeArgsDebug'.
> com.android.ide.common.res2.FileStatus cannot be cast to com.android.ide.common.resources.FileStatus
Usually a clean and then rebuild fixes this.
I unfortunately don't have a sample project that reproduces it. It is in our main work project so I can't share anything from there.
The only thing I noticed is that we started getting this error when we applied the safeargs plugin.