Skip to content

Conversation

@aarce-uncharted
Copy link

Removing default pagination as it has been causing intermittent issues.

const page = request.params.page

page.offset = parseInt(page.offset, 10) || 0
page.limit = parseInt(page.limit, 10) || 50
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few questions:

  • What does this solve?
  • Why not make this configurable rather than unlimited?
  • MemoryHandler is not used for many records in production. Are you changing the sequelize-handler as well?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a pr up for https://jira.uncharted.software/browse/DCE-2930, but after speaking with Rob it seems that the issue has more to do with the pagination defaults in the framework.

These defaults were causing us issues on requests not made with query in the client such as findAll, where it was only returning 50 when we were expecting the entire dataset which caused bugs intermittently. Making it configurable here will also only replicate the issue we have on the client where, from what I understand, we've had to periodically increase the limits we've set for pagination. Doing it this way lets the client explicitly specify when/how many to paginate by.

I think only MemoryHandler needs updating, from what I can tell sequelize already has checks in place:
https://github.com/jagql/store-sequelize/blob/master/lib/sqlHandler.js#L524

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This theoretically solves our paging issues. We should be able to get rid of our ember-data store.query override, and the server-side equivalents.

Copy link
Owner

@derekwsgray derekwsgray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • missing unit tests.

@derekwsgray derekwsgray merged commit e152536 into derekwsgray:master Jan 14, 2021
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

Successfully merging this pull request may close these issues.

3 participants