Incorrect behavior of mentions
Which packages are you using?
stream_chat_flutter
On what platforms did you experience the issue?
iOS
What version are you using?
4.3.0
What happened?
The problem is StreamMessageInput forces replacing all mentions (which is @{username}) with user id. So, we have following problems:
- Web version shows @{id} instead normal mention
- Push notifications also send notification with @{id} instead @{username}
The main problem in this line:
message = message.replaceMentionsWithId();
And it's not optional...
Steps to reproduce
1. Just create StreamMessageInput and send any message with mention
2. Look at this message on the web version
3. Look at this message in the push notification
Supporting info to reproduce
No response
Relevant log output
No response
Flutter analyze output
No response
Flutter doctor output
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Also web implementation haven't something similar: https://github.com/GetStream/stream-chat-react/blob/develop/src/components/Channel/Channel.tsx#L580
Hi @arteminthesky the react sdk does the same thing https://github.com/GetStream/stream-chat-react/blob/837c2f2c219b94ec5cc11fc4b8c350d12687e3ac/src/utils.tsx#L134-L137 The backend is working on a fix for doing the same on push notifications I'll close this issue since it's not really related to the flutter sdk
Hi @imtoori. Thanks for explanation.
Hey @arteminthesky, the reason we convert the username to id before sending the message is that there can be similar usernames but not Id.
You can also look at this issue for more info. https://github.com/GetStream/stream-chat-flutter/issues/1099
@imtoori @xsahil03x Hello there! How is it going with the backend fix? The issue is still reproduced. I understand that the issue is not on the client side, so I didn't open a new issue, though more than half a year has passed since your last answer. We have updated to the last version of stream_chat_flutter, by the way. We're using 5.3.0 at the moment.