perf: use hasMore instead of live count on merge suggestion lists#4261
Merged
Conversation
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
Contributor
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves merge-suggestion list performance by removing the bundled live COUNT(*) from standard list responses. Instead, the backend fetches limit + 1 rows and returns a boolean hasMore, and the frontend updates pagination/UI behaviors to rely on hasMore (while keeping explicit countOnly requests intact).
Changes:
- Backend
memberRepositoryandorganizationRepositorynow computehasMorevialimit + 1queries and stop returningcounton normal list responses. - Member/org merge suggestion pages and data-quality lists use
hasMorefor “Load more” visibility. - Member/org merge suggestion dialogs switch navigation/empty-state logic to
hasMore+hasSuggestion, including refetch-after-action behavior.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/modules/organization/pages/organization-merge-suggestions-page.vue | Uses hasMore instead of total count to drive “Load more” pagination. |
| frontend/src/modules/organization/components/organization-merge-suggestions.vue | Dialog navigation uses hasMore/hasSuggestion; refetches and steps back when current offset is empty. |
| frontend/src/modules/member/pages/member-merge-suggestions-page.vue | Uses hasMore instead of total count to drive “Load more” pagination. |
| frontend/src/modules/member/components/member-merge-suggestions.vue | Dialog navigation uses hasMore/hasSuggestion; refetches and steps back when current offset is empty. |
| frontend/src/modules/data-quality/components/organization/data-quality-organization-merge-suggestions.vue | Data-quality org merge suggestions list uses hasMore for “Load more”. |
| frontend/src/modules/data-quality/components/member/data-quality-member-merge-suggestions.vue | Data-quality member merge suggestions list uses hasMore for “Load more”. |
| backend/src/database/repositories/organizationRepository.ts | Removes bundled count from list response; computes hasMore via limit + 1 and slices results. |
| backend/src/database/repositories/memberRepository.ts | Removes bundled count from list response; computes hasMore via limit + 1 and slices results. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
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.
Summary
List requests for merge suggestions were still slow on large project groups because every page load ran a live
COUNT(*)in addition to the list query. This removes that bundled count: the API fetches one extra row to determinehasMore, and the UI paginates from that instead ofres.count. ExplicitcountOnlycalls are unchanged.Changes
getTotalCount()on list responses inmemberRepositoryandorganizationRepository; returnhasMorefrom alimit + 1query instead ofcounthasMorefor the load-more button instead of comparingtotalto loaded rowshasMorepattern for load morehasMorefor next-page navigation andhasSuggestionfor empty/actions state, replacing total-count-based prev/next and “X of Y” labels