Skip to content

Add query-based pagination to tasks controller#6948

Merged
ryancooley merged 1 commit intodevelopfrom
bugfix/FOUR-16632
Jun 17, 2024
Merged

Add query-based pagination to tasks controller#6948
ryancooley merged 1 commit intodevelopfrom
bugfix/FOUR-16632

Conversation

@nolanpro
Copy link
Copy Markdown
Contributor

@nolanpro nolanpro commented Jun 13, 2024

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() with get() here: edf579f

This 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

  • I have pulled this code locally and tested it on my instance, along with any associated packages.
  • This code adheres to ProcessMaker Coding Guidelines.
  • This code includes a unit test or an E2E test that tests its functionality, or is covered by an existing test.
  • This solution fixes the bug reported in the original ticket.
  • This solution does not alter the expected output of a component in a way that would break existing Processes.
  • This solution does not implement any breaking changes that would invalidate documentation or cause existing Processes to fail.
  • This solution has been tested with enterprise packages that rely on its functionality and does not introduce bugs in those packages.
  • This code does not duplicate functionality that already exists in the framework or in ProcessMaker.
  • This ticket conforms to the PRD associated with this part of ProcessMaker.

ci:package-savedsearch:bugfix/FOUR-16632

@processmaker-sonarqube
Copy link
Copy Markdown

@CarliPinell
Copy link
Copy Markdown
Contributor

@nolanpro The pagination is working fine also in develop branch:

Uploading bugfix-16632-develop.mp4…

@ryancooley ryancooley merged commit f69e33b into develop Jun 17, 2024
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.

4 participants