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

Update Returns #394

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Update Returns #394

wants to merge 4 commits into from

Conversation

GameCharmer
Copy link

No description provided.

Page Number was wildly inaccurate.  Unless your page size was set to 1, Page Number wasn't acting as a page number but instead was acting as a flat offset.  In an environment where you're "paging" through and incrementing by 1, you wind up with 499 duplicate items and 1 new item.

If you want to stick with pageNumber, please multiply the pageNumber by the pageSize when inserting into the query after startPosition.
@GameCharmer
Copy link
Author

I've also ran into an issue with pageNumber not acting as an actual page number in the FindAll method in DataService. Instead of multiplying the pageNumber with the pageSize to get the startPosition, pageNumber was being used directly in the query, effectively making it a startOffset and not a pageNumber.

Since that's the case, I've renamed the variable to startOffset to make its intent more clear. We could always rename it back and multiply properly if the original intent was to actually iterate by the pageSize

@1127
Copy link

1127 commented Jul 5, 2022

OMG GameCharmer - I just spent about 2 hours banging my head on the desk trying to figure out why the pageNumber was failing every time! It IS an offset. Shame on whoever wrote the code that way as it is clearly labeled and documented to be a page number.

@GameCharmer
Copy link
Author

@1127 If only they would accept pull requests :P

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.

2 participants