Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

Mentioning do not work when username ends with `.` and other special characters

Open gmsecrieru opened this issue 11 years ago • 24 comments

screen shot 2015-10-02 at 08 02 13

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

gmsecrieru avatar Oct 02 '15 11:10 gmsecrieru

Or change username policies to not let usernames starts or finish with dot.

AdrianoCahete avatar Oct 02 '15 13:10 AdrianoCahete

Updated: Looks like the problem is not related only to dots:

image

gmsecrieru avatar Oct 03 '15 18:10 gmsecrieru

@RocketChat/owners I guess the question we need to answer first is, do we want usernames ending in non alphanumeric characters?

I personally dislike usernames ending in a period or dash. I find it confusing.

Ex: Hey have you seen @ninja. around?

That's just my two cents.

geekgonecrazy avatar Oct 05 '15 15:10 geekgonecrazy

I agree with you guys.. we should not accept usernames ending with non alphanumeric characters.

sampaiodiego avatar Oct 05 '15 16:10 sampaiodiego

From a new user who is looking into this for his company perspective I agree with geekgonecrazy, ending in special characters could cause confusion (common punctuation more than others).

Hi there @user, how are you?

Am I speaking to @user and using proper punctuation or am I skipping punctuation and talking to @user,

emcguinness avatar Oct 05 '15 16:10 emcguinness

problem is the algorithm which suggests new usernames if they are taken and that adds a dot

ninja- avatar Oct 05 '15 16:10 ninja-

@ninja- correct. That's why I ask. Cause we either fix this and continue to allow this or make tweaks to username creation.

geekgonecrazy avatar Oct 05 '15 16:10 geekgonecrazy

What about UTF-8 usernames, especially for Chinese , Japanese and Korean,

发自我的 iPhone

在 2015年10月6日,上午12:11,Diego Sampaio [email protected] 写道:

I agree with you guys.. we should not accept usernames ending with non alphanumeric characters.

— Reply to this email directly or view it on GitHub.

ghost avatar Oct 05 '15 17:10 ghost

Thats a good point @steedos, we have to create a global UTF-8 REGEX for usernames and channels that takes that in consideration.

@ninja- are you having problems with this?

engelgabriel avatar Dec 09 '15 12:12 engelgabriel

@engelgabriel , changed my username to remove a dot. Algorithm which replaced my github username from ninja- to ninja. has a room for improvement

ninja- avatar Dec 09 '15 15:12 ninja-

Note that this issue also applies if the username does not end in a period.

screenshot from 2016-09-08 09-48-30

kyrofa avatar Sep 08 '16 16:09 kyrofa

@kyrofa yeah it looks like we need to get our regex around username matching fixed asap..

geekgonecrazy avatar Sep 09 '16 01:09 geekgonecrazy

Adding a space as a valid character in the regex breaks the mentioning completely when using the autocomplete

thef1sh avatar Oct 02 '17 16:10 thef1sh

if node.js supported negative lookbacks with regex this would be as easy as appending (?<![\.]) to the regexp.

Works in chrome, but does not work in node 8 or probably other browsers.

geekgonecrazy avatar Jan 27 '18 03:01 geekgonecrazy

@thef1sh if adding a space as a valid character breaks the autocomplete, then space should simply be a forbidden character when creating your nickname.

ChameleonScales avatar Mar 23 '18 21:03 ChameleonScales

@ChameleonScales With Custom OAuth and Office 365, your only options for user names are "Full Name" or "[email protected]", both of which break mentions. Not sure if I should open another ticket for having an @ in the username breaking mentions as well, or just mention it here.

ebyrne242 avatar Mar 27 '18 17:03 ebyrne242

but just why even allow a character that breaks a feature ? When you put a slash / in a filename inside a folder, you get a popup telling you that you can't do that, and you have to change the name. To me that's how it should behave. In the rocket.chat server I use, 90% of users have a space in their name because they're unaware of the consequences. That's a pity.

ChameleonScales avatar Mar 27 '18 22:03 ChameleonScales

@ChameleonScales because the custom OAuth module has no way to mangle data it receives from the oauth server to remove "illegal" characters?

ebyrne242 avatar Mar 29 '18 18:03 ebyrne242

@ChameleonScales @sketch242 Current "Names Validation" regexp is also used for channels and groups. Therefore you either have mentions working and no spaces, dots, commas, etc.. in usernames, groups and channels. Or you ignore mentions and everything else is working.

I'm not sure if mentions for complex usernames will ever be implemented but at least maybe it is possible to separate those regexes.

xzag avatar Mar 29 '18 20:03 xzag

@sketch242 I'm not talking about removing a character or mangling any data. My request is that when you click OK when creating your username, before actually validating, some script would first check if there's a space in your name and if there is, it would not validate and show a message telling you why. Of course everyone who already has a space in their name won't be affected by that. This is just for future newcomers. Do you think this would be doable ?

ChameleonScales avatar Mar 30 '18 13:03 ChameleonScales