Status Update
Comments
du...@google.com <du...@google.com>
jb...@google.com <jb...@google.com>
m....@gmail.com <m....@gmail.com> #2
Hello, can you please attach a sample that reproduces your error?
sm...@gmail.com <sm...@gmail.com> #3
I’ve attached two screen recordings demonstrating the mediator's behavior during the first and second launches after installation. Additionally,
ti...@gmail.com <ti...@gmail.com> #4
Based on first_launch_after_installation.mp4
, your paging state is indeed showing null
for nextKey, so it makes sense that Paging concluded there are no more items to load.
So I think the question is why the PagingState
contains only an empty page and null
values. My guess is either
- RemoteMediator REFRESH actually returned empty data - what is the returned
allNewsItems
value on initial REFRESH? - RemoteMediator REFRESH successfully loaded data and inserted it into database, but Paging hasn't processed that yet by the time Append is triggered, so PagingState is empty.
The second case doesn't seem likely though.
If you attach an executable app, I can look into this further.
Otherwise, you may gain more insight through Paging logs with adb shell setprop log.tag.Paging VERBOSE
. You can also try implementing RemoteKeys
in this
lv...@hubspot.com <lv...@hubspot.com> #5
Hey! I ran into this same issue. It is in fact the second case you mentioned and is documented
I've published a repo
Description
We should create a Paging3 API mirroring the existing Paging2 API,
DataSource.map
/DataSource.Factory.map
.This is not redundant with
PagingData.map
since it allows users to keep their domain models on the repository layer / modules, and the user does not always control the base implementation (e.g., mapping from Room's impl).One trouble is
.getRefreshKey()
requires mappingPagingState
, which then requires bi-directional mapping and a bunch of allocations. Ideally we could avoid this somehow...