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

fix(pagination): always enforce max size is set #820

Merged
merged 1 commit into from
Nov 6, 2024

Conversation

zepatrik
Copy link
Member

@zepatrik zepatrik commented Nov 6, 2024

We probably never want an unbound pagination. The specific implementation can still override the max page size.

@zepatrik zepatrik requested a review from aeneasr November 6, 2024 15:12
@@ -62,7 +65,7 @@ func (p *Paginator) Size() int {
size = 100
}
}
if p.maxSize > 0 && size > p.maxSize {
Copy link
Member Author

Choose a reason for hiding this comment

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

If for whatever reason p.maxSize is 0, we would set the size to 0 which is fine in this case.

@aeneasr aeneasr merged commit eadc5d5 into master Nov 6, 2024
10 checks passed
@aeneasr aeneasr deleted the fix/pagination/force-max-when-not-set branch November 6, 2024 15:44
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