Closed mishkeTz closed 1 year ago
We will check and get back to you :)
cc @khushal87
Umm, this will be easily reproducible since the name contains a special character )
that isn't escaped.
Thanks for brining this up. I am able to reproduce this issue and we will fix it as soon as possible.
Issue
The app breaks if the user name contains special characters.
Line that breaks the code:
useLatestMessagePreview.ts
const mentionedUsers = getMentionUsers(message.mentioned_users); const regEx = new RegExp(
^(${mentionedUsers}));
example of
message.mentioned_users
that will break the RegExp[{"banned": false, "created_at": "2023-04-25T09:19:40.933336Z", "id": "123123", "image": "https://some-url", "last_active": "2023-08-08T14:05:24.400094Z", "name": "Name :)", "online": false, "role": "user", "updated_at": "2023-08-07T20:31:58.690778Z"}]
Error catch:
[SyntaxError: Invalid regular expression: unmatched parentheses]
The tagged user needs to be in the last message of the channel. (or maybe even not) When you open the channels list (when there's a channel rendered with that @mention last message) it will break the app and show a white screen.
Steps to reproduce
Steps to reproduce the behavior:
Expected behavior
The app doesn't break. [white screen]
Project Related Information
stream-chat-react-native
version you're using that has this issue:5.11.2
e.g. Android 10
e.g. iPhone 11
Additional context