Fixed
Status Update
Comments
jd...@xooloo.com <jd...@xooloo.com> #2
Thanks for trying out Room KMP! This looks like an issue with Android 9+ and armv7 and the way we compile sqlite3.c, specifically linking to the atomic library in C. We'll try to get this fix as soon as possible.
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).