-
Notifications
You must be signed in to change notification settings - Fork 355
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
chore: move handling of total count and pagination to store [TECH-1664] #15486
Conversation
Codecov Report
@@ Coverage Diff @@
## master #15486 +/- ##
=========================================
Coverage 66.14% 66.15%
- Complexity 31183 31185 +2
=========================================
Files 3487 3487
Lines 129761 129752 -9
Branches 15136 15133 -3
=========================================
+ Hits 85829 85832 +3
+ Misses 36840 36830 -10
+ Partials 7092 7090 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 7 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
private Integer page; | ||
private Integer pageSize; | ||
private Boolean totalPages; | ||
private Boolean skipPaging; |
Check notice
Code scanning / CodeQL
Missing Override annotation Note
PageRequestParams.getSkipPaging
static final String DEFAULT_FIELDS_PARAM = | ||
"relationship,relationshipType,createdAtClient,from[trackedEntity[trackedEntity],enrollment[enrollment],event[event]],to[trackedEntity[trackedEntity],enrollment[enrollment],event[event]]"; | ||
|
||
private Integer page; | ||
private Integer pageSize; | ||
private Boolean totalPages; |
Check notice
Code scanning / CodeQL
Missing Override annotation Note
PageRequestParams.getTotalPages
static final String DEFAULT_FIELDS_PARAM = | ||
"relationship,relationshipType,createdAtClient,from[trackedEntity[trackedEntity],enrollment[enrollment],event[event]],to[trackedEntity[trackedEntity],enrollment[enrollment],event[event]]"; | ||
|
||
private Integer page; | ||
private Integer pageSize; |
Check notice
Code scanning / CodeQL
Missing Override annotation Note
PageRequestParams.getPageSize
static final String DEFAULT_FIELDS_PARAM = | ||
"relationship,relationshipType,createdAtClient,from[trackedEntity[trackedEntity],enrollment[enrollment],event[event]],to[trackedEntity[trackedEntity],enrollment[enrollment],event[event]]"; | ||
|
||
private Integer page; |
Check notice
Code scanning / CodeQL
Missing Override annotation Note
PageRequestParams.getPage
Kudos, SonarCloud Quality Gate passed! |
Having the logic of fetching pageSize + 1 relationships in the store and the removal of the extra relationship in the service is error prone. This is now done transparently in the store.
Total count is expensive and should thus be discouraged. Do not expose this as part of the service as its not needed right now.
In this PR
Remove any pagination related fields and methods from RelationshipQueryParams as these are fully represented by the PageParams.
Remove lastPage concept as it is not exposed
Validate pagination params in the controller