Username preceded by @ detected as email

@zogstrip I can’t upgrade without the rebuild now (there’s a docker_manager upgrade to do so the rebuild is mandatory and I have to wait tonight to do that).

I was wondering if you even fixed the error that appears when trying to type a username preceded by @

A message icon appears before the username (why?), no list of users appears when I’m typing.
I’m still on v1.9.0.beta11 +33 and all works well (no errors) until I type usernames without @ otherwise I get the error “There was an error changing the ownership of the post”.

I see that the message icon appears even when I try to add users in a group if I type @ (The requested URL or resource could not be found.)

Imho, adding usernames without or with @ should be allowed the same way, with no errors.

3 Likes

I did not fix that. The :email: is used to designate an email address. I think it’s a bug since it’s should at least have one character before the @.

8 Likes

Fixed via
https://github.com/discourse/discourse/commit/116ddec22e35f5ae9cc32ac4c348a91e6cb6450d

3 Likes

options.term.match(/@/)

@tgxworld shouldn’t this regex be something more like .@ or (?!^)@ ? i.e. requiring a non-empty local part for the email address

2 Likes

Good point. @nbianca Could you have a look at the regexp used here?

3 Likes

Hi @tgxworld,

I submitted PR #5804 to fix this.

4 Likes