Skip to content

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

@kfoisy

Description

@kfoisy

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions