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

SIRI-989: File Storage – Fix Duplicate Listing of Files and incorrect Total Count for Pagination #2020

Merged
merged 2 commits into from
Jul 12, 2024

Conversation

fhaScireum
Copy link
Contributor

Description

If directories are present, the total count can't just be calculated based on the number of SQLBlob / MongoBlob entities. While fixing this, a second bug emerged: The last file of a page is also listed as the first file of the next one.

Additional Notes

  • This PR fixes or works on following ticket(s): SIRI-989

Checklist

  • Code change has been tested and works locally
  • Code was formatted via IntelliJ and follows SonarLint & best practices
  • Patch Tasks: Is local execution of Patch Tasks necessary? If so, please also mark the PR with the tag.

…he current page.

The start is expected to be 1 for the first page, and 25 for the second if page size is 24.
However, Limit#getItemsToSkip returns 0 for the first page and 24 for the second page.

As a start value lower than 1 is ignored, this bug had no impact on the first page.

Fixes: SIRI-989
Generally, pages fetch the count of entries based on their base query. However, here, the base query does only consider SQLBlob / MongoBlob and not SQLDirectory / MongoDirectory.
Therefore, the count has to be resolved manually when directories are part of the result set.

Fixes: SIRI-989
@fhaScireum fhaScireum added the 🐛 Bugfix Contains only a small fix for an existing bug label Jul 12, 2024
@idlira idlira merged commit 57ef49a into develop Jul 12, 2024
4 checks passed
@idlira idlira deleted the feature/fha/SIRI-989-Filesystem-Pagination-Count branch July 12, 2024 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bugfix Contains only a small fix for an existing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants