Skip to content

Direct message conversations not sorted alphabetically #5341

@Igloczek

Description

@Igloczek

Right now users can create usernames with capital letters, which makes sorting results not so friendly, b/c instead of ['apple', 'Banana', 'Pineapple'], we have ['Banana', 'Pineapple', 'apple']. It's extremely confusing when you have opened like 30 chats all the time and everyone follows different naming convention (at all the best option will be to replace nicknames with real names, but AFAIK there is an open PR with this feature)

So we have few possible solutions:

Disclaimer: I'm not a back-end guy, I have no idea what's are good patterns here.

  1. Force users to use usernames without capital letters - for me this is best option, b/c users have to keep usernames unique, even now we can't create @user,@USER, @User and @UsEr, so why not make this simpler? Also this will make everything more consistent, b/c channel names are already limited to lowercase and it works as expected.

  2. Use caseInsensitive option for ensureIndex method, but it's available in MongoDB >= 3.3.11 -> https://jira.mongodb.org/browse/SERVER-90
    AFAIK Rocket.Chat didn't fit this requirements.

  3. Store additional field in DB with name in lowercase and use it for sorting purposes only. I tried to make this, but without luck 😢

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions