Fixed
Status Update
Comments
ni...@google.com <ni...@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
du...@gmail.com <du...@gmail.com> #3
yea i'll take it.
il...@google.com <il...@google.com>
wk...@google.com <wk...@google.com>
wk...@google.com <wk...@google.com>
il...@google.com <il...@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.
lo...@gmail.com <lo...@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()
}
}
wk...@google.com <wk...@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)
lo...@gmail.com <lo...@gmail.com> #7
yea sorry immediate does not fix it.
I actually have a WIP fix for it:
https://android-review.googlesource.com/c/platform/frameworks/support/+/1112186
if your case is the one i found (emitting same LiveData multiple times, as shown in #5) you can work around it by adding a dummy transformation.
val subLiveData = MutableLiveData(1)
val subject = liveData(testScope.coroutineContext) {
emitSource(subLiveData.map {it })
emitSource(subLiveData.map {it} )
}
I actually have a WIP fix for it:
if your case is the one i found (emitting same LiveData multiple times, as shown in #5) you can work around it by adding a dummy transformation.
val subLiveData = MutableLiveData(1)
val subject = liveData(testScope.coroutineContext) {
emitSource(subLiveData.map {it })
emitSource(subLiveData.map {it} )
}
Description
Navigation version: 1.0.0-alpha2
I recently added the new CL2 to my project alongside the Navigation library, where I have 2 navigation xml files that contain argument objects for some fragments.
The error I receive (there are multiple as there are multiple arguments) is:
> Android resource linking failed
error: 'integer' is incompatible with attribute type (attr) enum [deltaRelative=0, parentRelative=2, pathRelative=1] [weak].
error: 'string' is incompatible with attribute type (attr) enum [deltaRelative=0, parentRelative=2, pathRelative=1] [weak].