stream-chat-flutter icon indicating copy to clipboard operation
stream-chat-flutter copied to clipboard

Incorrect behavior of mentions

Open arteminthesky opened this issue 4 years ago • 5 comments

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:

  1. Web version shows @{id} instead normal mention
  2. 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

arteminthesky avatar Jun 23 '22 13:06 arteminthesky

Also web implementation haven't something similar: https://github.com/GetStream/stream-chat-react/blob/develop/src/components/Channel/Channel.tsx#L580

arteminthesky avatar Jun 23 '22 13:06 arteminthesky

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

imtoori avatar Jul 06 '22 09:07 imtoori

Hi @imtoori. Thanks for explanation.

arteminthesky avatar Jul 06 '22 09:07 arteminthesky

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

xsahil03x avatar Jul 06 '22 09:07 xsahil03x

@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.

chapsan2001 avatar Mar 15 '23 07:03 chapsan2001