Discourse suggested username is long and meaningless


(hosna) #1

Today I found that sometimes discourse suggests a very long and meaningless username like this:

image

Is there any explanation for this?


(Régis Hanol) #2

That’s weird… if you find reliable reproduction steps, we’ll fix it.


(David Taylor) #3

What do you have the max_username_length setting set to? The ‘username suggester’ tries 100 times to find an available username, and will then fall back to a random string. It looks like that’s what has happened for you.


(hosna) #4

Yes It seems exactly this situation happened for me. Idk but I think this is not a good way to produce the suggested username. maybe it would be better to use email too.


(David Taylor) #5

It does try and use the email to generate the username. Looking at the code, I think the only way it should generate a random string is if you have more than 100 users with a username “amir###” (where ### is a number).

Is that the case?


(hosna) #6

Yes It’s exactly my situation. However as far as I see, It doesn’t use the email by any means:

Screenshot_2018-10-15%20%D8%AA%D8%A7%D9%84%D8%A7%D8%B1%20%DA%AF%D9%81%D8%AA%DA%AF%D9%88%DB%8C%20%D8%B2%D8%A8%D8%A7%D9%86%D8%B4%D9%86%D8%A7%D8%B3