Fixed
Status Update
Comments
jd...@xooloo.com <jd...@xooloo.com> #2
The project uses plugin androidx.navigation.safeargs (version 1.0.0-alpha04) and that seems to change the version of the models to 3.2.0-beta03, causing the project to require an upgrade. If the plugin is removed from the project then the issue is gone. Can you confirm if the issue is gone after removing the plugin? I have attached a patch with the changes if needed.
du...@google.com <du...@google.com>
ap...@google.com <ap...@google.com> #3
So maybe this bug needs to be assigned to `androidx.navigation.safeargs` plugin team ?
Description
I'm using a custom PagingSource backed by a SparseArray and a RemoteMediator to feed the SparseArray when more items are needed and invalidates the PagingSource.
With the alpha08 version of Paging, I was having the same bug as the one reported by 172000108, but the insertSeparators function was working fine (I'm just displaying a header before each item).
With the snapshot version, it is not crashing anymore, but the insertSeparators is not inserting a header before the first item in the list.
It seems to me that it is related to the new terminatesStart function in Separators.kt on CombinedLoadStates. When I use a PagingSource generated by Room, it returns true, and the headers are all displayed.
But with a remote mediator, it returns false, that's why the first header might not displayed.
My remote mediator is first called with loadType REFRESH then with PREPEND (i always return endOfPaginationReached = true for this case, as I only append items). So the mediator.prepend of CombinedLoadStates is eventually terminal (first NotLoading(endOfPaginationReached = false) then NotLoading(endOfPaginationReached = true).
But my PagingSource is never called with a params Prepend (I would return an empty list and both null for prev and next keys if it was called). So source.prepend is never terminal (always NotLoading(endOfPaginationReached = false).