Fixed
Status Update
Comments
yb...@google.com <yb...@google.com>
yb...@google.com <yb...@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
yb...@google.com <yb...@google.com> #3
yea i'll take it.
yb...@google.com <yb...@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.
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()
}
}
Description
Component used: androidx.paging:paging-runtime
Version used: 3.0.0-alpha07
Discovered a bug where the scroll position is not preserved when page data is loaded outside visible area while only the placeholders are visible. This can happen when a PagingSource with placeholders enabled takes a while to load the data while user is scrolling through the recyclerview.
Sample project: Issue A fromhttps://github.com/yhpark/androidx-paging3-issues