Fixed
Status Update
Comments
ap...@google.com <ap...@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
ap...@google.com <ap...@google.com> #3
yea i'll take it.
jb...@google.com <jb...@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.
ad...@gmail.com <ad...@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()
}
}
ma...@gmail.com <ma...@gmail.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
When using the new fragment state manager , if a fragment is inflated after the host activity is RESUMED, via either the deprecated , the fragment never makes it to a RESUMED state.
<fragment>
tag orFragmentContainerView
In the case of the
<fragment>
tag:VIEW_CREATED
and never makes it any furtherfor
FragmentContainerView
:RESUMED
the first time, but on configuration change, the view that inflates the fragment is never attached to the new view hierarchy, so the fragment isRESUMED
but never actually visible.We should address this issue for both components. aosp/1591056 and aosp/1593053 have been implemented for the
<fragment>
tag case. This bug will track theFragmentContainerView
case.