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

Cursor-based pagination loads duplicate results #90

Closed
davidgoli opened this issue Sep 14, 2015 · 3 comments
Closed

Cursor-based pagination loads duplicate results #90

davidgoli opened this issue Sep 14, 2015 · 3 comments

Comments

@davidgoli
Copy link
Collaborator

Repro:

  • Implement twitter-style min_id pagination, instead of page-number-based pagination, using boundParams to recalculate the query params for each page: http://www.sitepoint.com/paginating-real-time-data-cursor-based-pagination/
  • Create an infinite model on a route with a template on a long page, but a small per-page count, so that the loader component is still visible after the first page of results has loaded

Result: The first page of results is rendered twice.

Although the page number is incremented, the updateInfinityModel method is not called on the first page load, and the infinityModelUpdated hook is only called afterRender and thus after the second page load is already triggered. Therefore, any params necessary for the query besides the page number have not been updated since the first page was loaded.

@ghost
Copy link

ghost commented Nov 17, 2015

Implement twitter-style min_id pagination, instead of page-number-based pagination, using boundParams to recalculate the query params for each page: http://www.sitepoint.com/paginating-real-time-data-cursor-based-pagination/

how did you do this? i cant find anything in the docs for ember-infinity.

@davidgoli
Copy link
Collaborator Author

@UnifiedInc This is still an open issue pending merge of #77 , at which time we'll add documentation illustrating its use. Fear not - the solution is very close at hand.

@hhff
Copy link
Collaborator

hhff commented Nov 25, 2015

closed with #105

@hhff hhff closed this as completed Nov 25, 2015
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