Add query-based pagination to tasks controller#6948
Merged
ryancooley merged 1 commit intodevelopfrom Jun 17, 2024
Merged
Conversation
|
CarliPinell
approved these changes
Jun 17, 2024
Contributor
|
@nolanpro The pagination is working fine also in develop branch: Uploading bugfix-16632-develop.mp4… |
boliviacoca
approved these changes
Jun 17, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

75.0% Coverage on New Code
0.0% Duplication on New Code
Issue & Reproduction Steps
See https://processmaker.atlassian.net/browse/FOUR-16632
Pagination was not working on task saved searches. We use task saved searches extensively for default in-progress and completed tasks lists.
Solution
We had done some refactoring to improve performance but a number of these changes introduced antipatterns and broke the saved search paginations.
It turns out, the performance issue actually came from a code change made many years ago where we replaced
paginate()withget()here: edf579fThis introduced a performance issue because it loads all tasks into memory from the database (even though it was being paginated before being sent to the front end).
Originally, this old change was made to support user filtering functionality that has sense been refactored (here) and is no longer needed.
The solution was to put back the old paginate method and remove the complicated performance logic. I also removed the user filter that is no longer needed (as mentioned above).
Because I put back
paginate(), this change should maintain the performance gains we made by Alex (but we should double check).How to Test
Related Tickets & Packages
Code Review Checklist
ci:package-savedsearch:bugfix/FOUR-16632