-
Notifications
You must be signed in to change notification settings - Fork 730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reproducible: ItemKeyedDataSource's loadBefore gets called infinitely #816
Comments
Following implementation of
|
mwajeeh
changed the title
ItemKeyedDataSource' loadBefore gets called infinitely
ItemKeyedDataSource's loadBefore gets called infinitely
Aug 30, 2019
Any updates on fix? |
mwajeeh
changed the title
ItemKeyedDataSource's loadBefore gets called infinitely
Reproducible: ItemKeyedDataSource's loadBefore gets called infinitely
Sep 3, 2019
No update, feel free to submit a PR to fix it. Does this need to be a separate issue from #621? |
mwajeeh
added a commit
to mwajeeh/epoxy
that referenced
this issue
Sep 3, 2019
Adjust last position if inserted item is before last position. Fixes airbnb#816 and airbnb#621
Both issue seem same to me. |
Closing because #621 was opened first, move communication there |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is a similar issue here #621
I just attempted to convert custom two way paging mechanism to epoxy paging library and this issue is making it impossible. I am attaching the code which can easily reproduce this.
PagedListModelCache
relies onlastPosition
to triggerloadAround()
and I think thats where the bug is.How to reproduce?
When you launch this activity, you will see that first page keeps loading which is expected. Now if you scroll down 1 or 2 pages and then scroll up just enough to trigger
loadBefore()
then you will see that it will still go in infinite loop invokingloadBefore()
. This is becauselastPosition
is stored indefinitely inPagedListModelCache
.updateCallback.onInserted()
->requestModelBuild()
->modelCache.getModels()
->lastPosition?.let{triggerLoadAround()}
->updateCallback.onInserted()
Following is modified code from epoxy paging sample that can easily produce this issue: https://github.com/airbnb/epoxy/tree/master/epoxy-pagingsample
The text was updated successfully, but these errors were encountered: