Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: mentions in some scenarios doesn't work #2368

Open
kennyvallejodev opened this issue Apr 18, 2024 · 1 comment
Open

bug: mentions in some scenarios doesn't work #2368

kennyvallejodev opened this issue Apr 18, 2024 · 1 comment
Labels
bug Something isn't working cluster:@mentions cluster:message-input Issues related to message input and its textarea status:confirmed Described issue has been reproduced by the repo maintainer

Comments

@kennyvallejodev
Copy link

Describe the bug

A clear and concise description of what the bug is.
There are some cases where the mentions don't work at all (it don't render the component as a mention)

  • Whenever you have a name that has an emote in it (e.g Kenny🟢)
Screen.Recording.2024-04-18.at.11.31.14.AM.mov
  • Whenever you have a name that has some spaces in it (e.g Kenny. )
Screen.Recording.2024-04-18.at.11.32.42.AM.mov
  • Whenever the name of the user you mentioned before is changed (the mention stop working)

Creating the mention (and working)
(by creating the video i found another problem :)))) okay guys i definitely need some help here to fix this. is driving me crazy)

Screen.Recording.2024-04-18.at.11.35.16.AM.mov

Mentioning the same user but with a new name

Screen.Recording.2024-04-18.at.11.40.35.AM.mov

To Reproduce

Steps to reproduce the behavior:

Scenarios
[a] emote in name
1. go to chat
2. set your name as Kenny🟢)
3. with another user in a channel where both user are members try to mention @Kenny🟢

[b] spaces in name
1. go to chat
2. set your name as Kenny. )
3. with another user in a channel where both user are members try to mention @Kenny.

[b] old mention broken after same user change their name
1. go to chat
2. set your name as Kenny)
3. with another user in a channel where both user are members try to mention @Kenny
4. now as Kenny go again and change your name now to Kenny 2
5. with the same other user, try to mention @Kenny 2
6. The @Kenny 2 mention will work but the old @Kenny mention will stop working and will be displayed as a normal text

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Package version

  • stream-chat-react: ^11.14.0
  • stream-chat: ^8.25.1

Desktop (please complete the following information):

  • OS: [e.g. iOS] MacOS Sonoma 14
  • Browser [e.g. chrome, safari] chrome
  • Version [e.g. 22] 123

Smartphone (please complete the following information):

Additional context

@kennyvallejodev kennyvallejodev added bug Something isn't working status: unconfirmed labels Apr 18, 2024
@arnautov-anton
Copy link
Contributor

Hey, @kennyvallejodev, thank you for your submission. The issue with the emote is a valid one, and we'll look into it.

On the other hand, the issue with trailing (or leading) spaces feels to me like a "data cleanup" issue that should be solved on the BE. Any trailing/leading spaces should be removed before updating the name, as I don't feel these provide any actual value.

The issue with the updated display name is a bit tricky as we match the mentioned user based on the display name that is being submitted as text. If the name in the message text is not updated then it's unlikely we can match the new name (from the mentioned_users array) to the old one. One way to mitigate this issue would be to mention users by their id's, thus always relying on somewhat permanent piece of data. The other way would be to use a Markdown form of sorts during message composition but that would come with the cost of other potential issues and unnecessarily lengthy messages (also an update from all of the other SDKs to handle this correctly):

Hey [@user display name](user_id) how are you doing?

Lastly, make BE update all the messages with mentions upon user display name change, but that seems unlikely as this might be expensive.

Again, thank you for your submission, we'll discuss this with the team and update this thread accordingly. 👍

@arnautov-anton arnautov-anton added status:confirmed Described issue has been reproduced by the repo maintainer and removed status: unconfirmed labels Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cluster:@mentions cluster:message-input Issues related to message input and its textarea status:confirmed Described issue has been reproduced by the repo maintainer
Projects
None yet
Development

No branches or pull requests

3 participants