Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit d1870fdee21557cdb2c7919d61ab6c8f37f9390f
Author: Dustin Lam <dustinlam@google.com>
Date: Wed Jun 10 16:04:02 2020
Check for pagingSource re-using in factory
Fixes: 158486430
Test: ./gradlew paging:paging-common:test
Change-Id: I99809eba7ca878fb841d2f250387d6b989ef701e
M paging/common/src/main/kotlin/androidx/paging/PageFetcher.kt
M paging/common/src/test/kotlin/androidx/paging/PageFetcherTest.kt
https://android-review.googlesource.com/1329737
Branch: androidx-master-dev
commit d1870fdee21557cdb2c7919d61ab6c8f37f9390f
Author: Dustin Lam <dustinlam@google.com>
Date: Wed Jun 10 16:04:02 2020
Check for pagingSource re-using in factory
Fixes: 158486430
Test: ./gradlew paging:paging-common:test
Change-Id: I99809eba7ca878fb841d2f250387d6b989ef701e
M paging/common/src/main/kotlin/androidx/paging/PageFetcher.kt
M paging/common/src/test/kotlin/androidx/paging/PageFetcherTest.kt
Description
val pagingSource = database.reposDao().reposByName(dbQuery)
return Pager(
config = PagingConfig(pageSize = NETWORK_PAGE_SIZE),
remoteMediator = GithubRemoteMediator(
query,
service,
database
),
pagingSourceFactory = { pagingSource }
).flow
But this will lead to a wrong behaviour of paging, as the paging source isn't created again.
The issue would be hard for developers to debug, therefore, the library should prevent this behaviour.