chore: member list is randomly sorted #31891
Open
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.
Issue: ( #22145)
The current implementation of the channels.members endpoint does not provide members in alphabetical order, causing inconvenience to users who expect a sorted list. This issue makes it challenging for users to locate specific members without using the search functionality.
Changes Made:
In this pull request, I have addressed the sorting issue by modifying the channels.members endpoint to ensure that the member list is sorted alphabetically by username before being returned in the API response. This enhancement will provide users with a more organized and easily navigable member list within channels.
Testing:
I have thoroughly tested the changes to ensure their correctness and effectiveness:
Dependencies:
This pull request introduces no new dependencies. The sorting logic leverages the localeCompare() function to ensure accurate alphabetical sorting based on user usernames.
Additional Notes:
The proposed changes aim to enhance the user experience by providing a more intuitive and organized member list within channels. By sorting members alphabetically, we aim to streamline navigation and improve user satisfaction.