Fixed
Status Update
Comments
du...@google.com <du...@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...@google.com <du...@google.com> #3
yea i'll take it.
so...@gmail.com <so...@gmail.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.
du...@google.com <du...@google.com>
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()
}
}
me...@yhpark.io <me...@yhpark.io> #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
Component used: androidx.paging:paging-runtime
Version used: 3.0.0-alpha07
When a PagingSource is invalidated before it has loaded any page, the subsequent PagingSource does not get
getRefreshKey
called and initial load key is passed as null.Sample project: Issue B fromhttps://github.com/yhpark/androidx-paging3-issues