Skip to content
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

Loading previous pages causes next page data to load incorrectly #349

Open
kfoisy opened this issue Dec 20, 2018 · 1 comment
Open

Loading previous pages causes next page data to load incorrectly #349

kfoisy opened this issue Dec 20, 2018 · 1 comment

Comments

@kfoisy
Copy link

kfoisy commented Dec 20, 2018

Steps to reproduce:

  • Load a new infinity model with a startingPage greater than 1
  • Load data for a previous page, then
  • Load data for a next page

Expected result: The next page data loads the page after the startingPage
Actual result: The next page data loading the startingPage's data again and inserts it into the list.

I've reproduced this in an Ember twiddle here: https://ember-twiddle.com/a5b7a21d64accee06ccb9217f2778e84

Digging around in the ember-infinity source code, it looks like currentPage is incremented and decremented based on whether you are loading the previous and next pages. I think that will need to be changed to two variables: one that indicates what the first page is (for previous page loading), and another to indicate what the last page is (for next page loading).

Let me know if I'm missing something here. I'd be happy to try to put together a pull request if you agree that the bug exists and like my proposed solution. In the meantime, I think I can workaround the issue by creating a custom InfinityModel class to override the buildParams function

@johncalvinyoung
Copy link

johncalvinyoung commented Dec 20, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants