-
Notifications
You must be signed in to change notification settings - Fork 87
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
User mention is not highlighted unless I reload the chat #578
Comments
Hi @f3dm76, We can't reproduce this issue on our default components (see the attached video). Are you maybe using some custom components around the text messages that might be causing this? RPReplay_Final1723536643.MP4Best, Martin |
Hey @martinmitrevski, I just removed the usage of a custom ViewFactory completely - here is all I do: I understand that you cannot reproduce, I see indeed that it works in your chatUI example project. Does this example use actual BE? Maybe it works because there is no real life latency for message appearing? The fact that the mentions are only checked on onAppear of a message looks incorrect - I can clearly see while debugging that it gets called with empty mentionedUsers. When adding onChange like I said, mentionedUsers come there. |
The message already includes the mentioned users, therefore it's safe to check this in In any case, if it works for you by adding an |
I just commented out all of the DemoAppFactory's body - and it stopped working on SC example project. onChange I added is inside SC library code, I'd like to avoid moving to a fork over such a simple matter. |
Hey @martinmitrevski, were you successful in reproducing the issue the way I described? |
Hi @f3dm76, yes, I can reproduce it. Seems like an issue in our low-level client, we will check it. If it's not, we will apply your fix instead. |
Will be fixed here: #582. |
What did you do?
I typed in @<user_name>, picked a name from the built-un mentions picker, and sent a message. Then I tapped on the user name prefixed by @ inside the message.
What did you expect to happen?
I expected that in the message body my user mention would be highlighted with a corresponding link color. I also expected the link tap handler to be called when I tap the mention.
What happened instead?
Nothing happened - it's just a plain text. It only starts working once I go away from the chat and come back again.
GetStream Environment
GetStream Chat version: StreamChat 4.61.0, StreamChatSwiftUI 4.61.0
GetStream Chat frameworks: StreamChat, StreamChatSwiftUI
iOS version: ios 18.0
Swift version: 5
Xcode version: 15.0.1
Device: sim iPhone 15 Pro Max
Additional context
I fixed it locally by adding
.onChange(of: message.mentionedUsers)
toLinkDetectionTextView
and duplicatingonAppear
body inside of it. But you might have a better approach in mindHere is a video of the bug
https://github.com/user-attachments/assets/795f2036-522c-49f8-b444-f23520de216b
The text was updated successfully, but these errors were encountered: