Fixed
Status Update
Comments
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
ju...@gmail.com <ju...@gmail.com> #3
yea i'll take it.
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.
ju...@gmail.com <ju...@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>
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-alpha02
Devices/Android versions reproduced on: all devices (e.g. Pixel 2, Android 8.1.0, API27)
I'm not quite sure this is a bug but I'm having trouble using Navigation UI component with both standard Toolbar and CollapsingToolbarLayout. Is there a plan to include some kind of support for this?
Because switching between items in the bottom navigation that I have and having some of the screens using standard toolbar and some of them CollapsingToolbarLayout it is really difficult to combine.
I went for a solution of having a standard Toolbar in the Activity and CollapsingToolbarLayout in the fragment and when I display this fragment, I hide the toolbar in the Activity. This however creates ugly flickering and moving of the content, which looks bad and also it happens so that Bottom navigation bar gets pushed down too much until I invalidate it.