Mentioning problem with short usernames


I have a user who has a username of one character (f). Since Discourse 1.5.betaX mentioning that user with @f does not work anymore. I can remember that it worked in Discourse 1.4.X.

(Jeff Atwood) #2

The database queries are too expensive when matching a single character.

(Jeff Atwood) #3

Do you support amending this query with the site setting of minimum username length, @sam?

(Mittineague) #4

If the auto-suggest starts working on the first sign of the token like the emoji does, I hate to think of the resource cost of all the false starts.

If it could happen after the “end token” (a space?) it might not be so bad.

(Sam Saffron) #5

I don’t know, @zogstrip introduced this change cause autocomplete usernames was brutal.

I feel like single letter usernames are such an edge case that I don’t want to even risk making any changes there. Maybe if we supported Chinese usernames one day I would be more open to hacking on this further.

(Jeff Atwood) #6

(Régis Hanol) #7

I have tested against our largest instances and username autocomplete is super fast, especially on 1-letter username. What I am missing here?

Since we can’t use SiteSettings in the mention dialect, I pushed this fix to allow for any username length. It was limited to at least 2 characters before that. (cc @rumpelsepp)