We need to allow longer usernames. Youtube api version 1 had shorter usernames, I think it was 20 chars, then in v3 they made the usernames to be 52 or 54 chars(not sure right now, I'll have to find that stackoverflow discussion again if you insist).
Maximum length of a Facebook username is currently 50 characters.
I reported this issue before, but it disappeared into thin air, so I'm bringing it up again because it's still an issue. I will make a pull request sometime today to make the username max length 50 chars.
However 64 chars would be better, just because Google and Facebook set a limit of 50, doesn't mean we have to set their exact limit. We are in fact creating this project because youtube is too limiting, if I'm not mistaken.
When a username is too long below the videos it just shows the three dots ..., so no big deal, no good reason for us to set such a short limit. I'll make it 50 because it's already kind long at 50, but in like 5 years we can talk about this again to see if maybe we should set it to 64. Also we should allow underscores _ in the username, for readability in case some users want them. looks like the pattern allows dots and underscores in the username as it is but for some reason there's a bug Validators.pattern(/^[a-z0-9._]+$/) which doesn't allow it on the frontend. In the database all these fields are already VARCHAR(255) so there's no need to create a migration for this.
Since I'm updating username to be longer I will also update channelName to be longer too at 50 chars.
Before I tried to make it so the admin can set the max length for the usernames in the config, but really that's not needed, what is better is to just increase the limit to 50 and all instances can have the same max limit of 50
For when the username gets cut off with the ... we can make it show the full username on hover.
We should also make the minimum to be a single char, not sure why 3 is the minimum, but twitter allows a single char for a username, so long as it starts with a letter and not a _ or a . or a -. We should also allow uppercase in the usernames and dots, underscores and dashes. So users can have camelCase usernames if they want, or separated by underscores or dashes or dots.
Validators.pattern(/^[a-zA-Z0-9]+[a-zA-Z0-9-._]+$/)
A good place to validate this regex online is https://regexr.com/
I've created another issues about field min/max lengths in regards to the user_ban_reason #1264
In the constants we have channel_name max 120, but on the frontend we have 20. In that case I will just make it 50 just like the username and make the display name also 50, considering that youtube sets a limit of 30 on the channel title.
pull request created to resolve this issue #1265