Usernames getting modified – numeral "1" being added

AI-generated summary

Issue with Usernames Getting Modified

The issue occurred on a Discourse instance integrated with a WordPress site using the Discourse SSO plugin. Two users out of 50+ had their usernames modified by appending the numeral “1” in Discourse, although their WordPress usernames remained unchanged.

david suggested that the issue might be related to group names sharing the same namespace as usernames. tnorthcutt confirmed the presence of groups with names equal to the modified usernames.

david explained that normally, attempting to create a group with an existing username should result in an “unavailable” error, rather than appending a numeral to the username. However, a previous bug with validation might have caused the issue, which is now fixed to prevent similar situations in the future.

I run a Discourse instance and WordPress site, using the Discourse SSO plugin (which is awesome).

Recently, two (out of 50+) had 1 appended to their usernames in Discourse. Their usernames on the WordPress site remains unchanged.

I tried to manually edit their usernames back in Discourse, but encountered the error message Username must be unique. However, the username (without the 1 appended) is unique.

Is this a known issue? Is there a workaround for this problem?

Happy to provide whatever other info would be useful for debugging.

Do you have any groups with names equal to the usernames? Group names and usernames share the same namespace

Ah, yes!

So will Discourse let you create a group with the name of an existing user, and append 1 to the username, rather than saying “Sorry, you can’t use that group name” when attempting to create the group?

No, you will get “Group name is not available”.

We had a bug with the validation a few months ago, which might be why you ended up with this situation. The bug is now fixed, so it shouldn’t happen in the future.

Cool, thank you @david