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

feat: Raise the default for pagination limit at the projects endpoint to 100 (DEV-4095) #242

Merged
merged 2 commits into from
Sep 11, 2024

Conversation

seakayone
Copy link
Contributor

@seakayone seakayone commented Sep 11, 2024

The old dsp-meta-svc did not paginate when the _limit and _page pagination parameters where not provided and returned all projects.

The new implementation provides default values for the _limit=10 and _page=1. This was done because APIs that return large datasets or perform unbounded queries without pagination can lead to high memory, network and CPU usage. Hence commonly pagination works with default values for the pagination params.

This PR solves the problem for the time being by raising the limit to be higher than the current number of projects (100>55).

Should the number of projects reach more than 100 the clients would have to get the next page. The PR should give them enough time to adopt.

Copy link

linear bot commented Sep 11, 2024

Copy link

codecov bot commented Sep 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.8%. Comparing base (4fb32bd) to head (4e702e2).
Report is 1 commits behind head on main.

Additional details and impacted files
Files with missing lines Coverage Δ
src/domain/metadata_repository.rs 90.5% <100.0%> (+0.3%) ⬆️

@seakayone seakayone self-assigned this Sep 11, 2024
Copy link
Contributor

@mpro7 mpro7 left a comment

Choose a reason for hiding this comment

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

It's unrelated to the fact that on the FE we display 9 projects per page, right?

@seakayone
Copy link
Contributor Author

It's unrelated to the fact that on the FE we display 9 projects per page, right?

It just changing the defaults, the projects page sets those params.

@seakayone seakayone merged commit 522b1ad into main Sep 11, 2024
16 checks passed
@seakayone seakayone deleted the feat/raise-limit-default-to-100 branch September 11, 2024 13:06
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