stream-chat-react-native
stream-chat-react-native copied to clipboard
Incorrect mention multiple users
Issue
Bug if we mention multiple users with same name (just have extra word in last name for example acc 1: 'first middle', acc 2: 'first middle last') it would incorrect mentioning account.
Steps to reproduce
Name account 1: 'example name' Name account 2: 'example name 2'
Mention account 1 and mention account 2 in the same time: 'Hi @example name and @example name 2' the word 2 will not include on mention thats make only mentioning account 1 'Hi @example name and @example name 2'
Tech:
- RN: v0.72.12
- stream-chat-react-native: v5.19.3
Evidence video
https://github.com/GetStream/stream-chat-react-native/assets/96037957/b05e4a1b-5653-4c26-b2c6-8e97dbc4701d
Hey @krisnapy, I was able to to reproduce this issue with our SDK. It is primarily due to regex that we have for the mentioned users:
const regEx = new RegExp(`^\\B(${mentionedUsers})`, 'g');
Eg:
/^\B(@vishal|@vishal 2|@Vishal Narkhede)/g
This doesn't take space and numbers in the usernames. We will try to look into it and fix the regex once we find a solution.
:tada: This issue has been resolved in version 5.30.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket: