Skip to content

Conversation

@gaurav-gravitee
Copy link
Contributor

@gaurav-gravitee gaurav-gravitee commented Dec 8, 2025

Issue

https://gravitee.atlassian.net/browse/APIM-10754

Description

Eliminated duplicate entries in organization search users results.
Issues like:

  1. Duplicate records on different pages
  2. Search results are different when searched again using same params(Intermittent results)
  3. Sorting behaviour confusing

Additional context

Also, removed the sorting after pagination: #12945

@gaurav-gravitee gaurav-gravitee requested a review from a team as a code owner December 8, 2025 14:13
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @gaurav-gravitee, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses and resolves several intermittent issues related to user display in organization search results. The primary goal was to eliminate duplicate user entries, ensure consistent search outcomes across repeated queries, and rectify confusing sorting behaviors. This was achieved by shifting the sorting responsibility to the search engine and refining the post-search processing to guarantee uniqueness and maintain the intended order of results, significantly improving the reliability and user experience of the user search functionality.

Highlights

  • Duplicate User Entries Resolved: The core issue of intermittent duplicate user entries appearing in organization search results has been fixed, ensuring each user appears only once.
  • Consistent Search Results: Search results for users are now consistent, addressing problems where repeated searches with the same parameters yielded different or intermittent outcomes.
  • Optimized Sorting Logic: User sorting is now handled directly by the search engine, eliminating client-side sorting after pagination. This improves efficiency and ensures correct ordering, resolving previous confusing sorting behaviors.
  • Refactored User Search Implementation: The internal logic for fetching and processing user search results has been streamlined, removing manual de-duplication steps and ensuring the order returned by the search engine is preserved.
  • Enhanced Test Coverage: New unit tests have been added to specifically validate the removal of duplicates within pages, consistency of results across repeated queries, and correct handling of duplicates across different pages.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request addresses intermittent duplication and sorting issues in user search results. The core change involves moving the sorting responsibility to the search engine, which correctly ensures stable ordering across paginated results. The removal of client-side sorting logic is appropriate. The new tests added are comprehensive and cover the scenarios described in the issue, such as handling duplicates and ensuring consistent results.

My review includes one suggestion for a performance improvement in how the search results are processed to build the final list of users, replacing an inefficient sorting operation with a more performant map-based lookup.

@gaurav-gravitee gaurav-gravitee force-pushed the APIM-10754-duplicate-user-records branch from d8fe3d4 to 0a202ad Compare December 9, 2025 12:32
@gaurav-gravitee gaurav-gravitee force-pushed the APIM-10754-duplicate-user-records branch from 0a202ad to b7661cf Compare December 9, 2025 18:29
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.

3 participants