Discourse suggested username is long and meaningless

(hosna) #1

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


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: