Status Update
Comments
ba...@gmail.com <ba...@gmail.com> #2
I have the same issue after updating the dependencies. If you call refresh on the custom paging source adapter, then the crash happens. I searched online for the solution and no luck :(. I did some workout by not calling refresh and calling the notify function inside adapter for every new data updates.
ni...@gmail.com <ni...@gmail.com> #3
Hi, which version you were using and updated to? Sample project has the latest 3.3.0
ba...@gmail.com <ba...@gmail.com> #4
3.3.0
ni...@gmail.com <ni...@gmail.com> #5
Thanks, 3.3.0 is the latest, which version did you have previously?
lo...@gmail.com <lo...@gmail.com> #6
same same. Now to waste a lot of time trying to work out what versions I have to roll which libraries back to.
Description
Hi, I have been struggling with this for some time and finally decided to post there to make sure it is not me doing something wrong.
Please see attached POC, screen recording and sample crash log in the attached file. Project is created with Android Studio Koala Feature Drop | 2024.1.2 Canary 5
Issue:
Attached project demonstrates crash with a Room database but I use custom
PagingSource
because I also use Paging 3 with content providers such as call log and contacts.Due to my my project's needs, I need to invalidate
PagingSource
from outside every now and then. One of the reasons for that is inserting adverts to certain locations.I created
Invalidator
interface whichInvalidatingPagingSource
that extendsPagingSource
uses.InvalidatingPagingSource
in return extended by my custom paging source andViewModel
is provided with an instance ofInvalidator
so it can callInvalidator.invalidateNow()
when it needs to invalidate the paging source.This setup works fine when data is on screen and no scrolling is being done. However, if invalidation happens while user is scrolling app crashes with
I am not sure if I am being thick but, when I check the source of tryGetViewHolderForPositionByDeadline I see that it does these checks:
According to log however,
position 115(offset:115)
falls in tostate:207
so crash should not happen. What am I missing?Notes: