Fixed
Status Update
Comments
il...@google.com <il...@google.com>
sa...@google.com <sa...@google.com>
sa...@google.com <sa...@google.com>
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.
sa...@google.com <sa...@google.com>
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.
na...@google.com <na...@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()
}
}
co...@gmail.com <co...@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
Version used: 1.5.1 (also tested on 1.7.0-alpha01)
Devices/Android versions reproduced on: Pixel 5 API 30 emulator
Description:
The linked repo or ZIP contains a reproduction of an issue with the AppCompatDialog & Componentdialog. It shows that the ComponentDialog does not set the ViewLifecycleTreeOwner correctly when setContentView is called. AppCompatDialog (the subclass of ComponentDialog) does not call super.setContentView and instead calls a delegate which never reaches ComponentDialog. When trying to access the ViewTreeLifecycleOwner of the dialog, a null pointer exception is thrown.
If this is a bug in the library, we would appreciate if you could attach:
-
- ZIP also attached