-
-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(user): enforce uniqueness on display names #2528
fix(user): enforce uniqueness on display names #2528
Conversation
From your migration SQL:
Wouldn't it be better to set Probably doesn't really matter. The only users with display_names set are the ones that had non-ASCII characters: https://discord.com/channels/476211979464343552/1002697125081124986/1167420029113999370 |
Don't we still want to maintain those unicode values that already exist? (where not null, and resolve uniqueness) |
If we do, I still think we should throw out the ones that I categorized as "crazy" earlier: DELETE FROM UserAccounts
WHERE display_name NOT REGEXP '^[[:alpha:][:digit:][:space:]_.-]+$'; then: UPDATE `UserAccounts`
SET `display_name` = 'User'
WHERE `display_name` IS NULL; |
@luchaos - Since you went through the effort of transferring the non-ASCII usernames to the display_name field, what are your thoughts on sanitizing them? There are currently six accounts that are incompatible with a unique key on display_name:
Five of which haven't even been used as far as I can tell. |
All |
Going to go ahead and merge this to get it off our plate. I'm not sure if we want to run this SQL query in any environment: UPDATE `UserAccounts`
SET `display_name` = `User`; MariaDB treats NULL as unique, and we currently don't have any code to write this value on new account creation (and I'm not sure that's desirable). My thinking right now is we continue to leave all |
SQL to Run Before Migration/Deployment:
This PR adds a uniqueness constraint on
UserAccounts.display_name
. I don't believe it's desirable for two users to have the samedisplay_name
.Also, the user profile route now supports navigation by
display_name
in addition toUser
.