-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
username/display_name/video_channel_name min length 1 and max length 50 #1265
username/display_name/video_channel_name min length 1 and max length 50 #1265
Conversation
2fa0e44
to
29faa6c
Compare
29faa6c
to
3ecd383
Compare
89f6121
to
2b46153
Compare
Do you still have the frontend bug? |
@rigelk yes, not sure if it's something on my end only, but it still complains about username being less than 3 or more than 20 chars, but can "Inspect" the elements and remove the I've looked all over the codebase to see what else could be causing it but can't seem to find anything else, pretty sure I changed all places that apply. Could it be the locales? |
Could possibly be a bug in the validator, unless it's using the locales somehow to do the validation, which doesn't make sense but that could be part of the bug. |
We should probably add some better tests for this buggy issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't reproduce your bug with a development environment: yarn run dev
. Please review your regex too.
client/src/app/shared/forms/form-validators/user-validators.service.ts
Outdated
Show resolved
Hide resolved
Wait so you can create a username with a single letter or a username with more than 20 chars long without seeing the validation errors? if so then for sure it's only with my environment |
I've been using Update: It does the same thing with node 8.12.0, I'll have to clone the project in a separate directory to see how it behaves next. Update: had to fix the regex to be Update: there's some serious bug in the frontend validator, the regular expression specifically doesn't allow a username to start with and if I enable global multiline in the regexr.com while testing the regex, the regex notation is valid, so it must be some major bug with the validator and the way it parses the regex perhaps. Update: Update: I figured out what the problem was, I was accessing the site on port 9000, while I should have been accessing it on port 3000, after this all those validation errors went away. Now I can get back to getting this finished up, finally! |
2b46153
to
64779bb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please test video channels name too (check-params/video-channels.ts
)
client/src/app/shared/forms/form-validators/user-validators.service.ts
Outdated
Show resolved
Hide resolved
client/src/app/shared/forms/form-validators/video-channel-validators.service.ts
Outdated
Show resolved
Hide resolved
64779bb
to
97e720a
Compare
All my tests seem to work all good, now that I figured out port 3000 not port 9000. Everything works great, I think this is ready to be merged unless you guys want to add something else like more tests that check the different variations of username or video channel names that can be created. |
97e720a
to
ebaad2a
Compare
I had to amend/modify the commit message(remove a semicolon) and push force to make it pass these tests that have nothing to do with what this pull request fixes. If it passes this time, and you guys agree with the changes then please merge. Keep up the great work guys, lots of people need this platform. |
…ax length 50; (fixes Chocobozzz#1263); ! still some bug on the frontend complains but if you remove the disabled property it creates the account just fine; allow for usernames to start with a number; fix test, since username can be 1 char now make test check empty; fix test, Should fail with a too long username; fix test, Should fail with a too small username; fix regular expression for username and videoChannel; change username, videoChannel to be lowercase and fix message;
9ebe1d3
to
11d86c3
Compare
Should be fixed if you rebase develop |
I'll fix the merge conflict right now |
669ae92
to
4c8aff2
Compare
Can you guys still see this pull request? My account got flagged again, github can lick my gonadz I wasn't even doing anything this time, just creating a gist note for myself, bastards, can't even work on github |
@Chocobozzz @rigelk If you can please merge this it would be great otherwise I'll have to create another account and re push this these changes on a different pull request. My account keeps getting flagged by github and they tell me to contact the owner of this repo, then I look crazy, but reality is they are a bunch of clowns. I'm starting to really hate github after loving it so much for over a decade. |
Validators.pattern(/^[a-z0-9._]+$/) | ||
Validators.minLength(1), | ||
Validators.maxLength(50), | ||
Validators.pattern(/^[a-z0-9][a-z0-9-._]*$/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
char is not accepted by mastodon i think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll have to fix that, or maybe we can have mastodon accept it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is two issues at least:
- Support hyphens in usernames mastodon/mastodon#9309
- Allow user name containing "-" for remote accounts mastodon/mastodon#9066
but that doesn't seems to be planned for the moment..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me it seems that mastodon accepts everything accept the .
char, which it removes if it sees it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say it's safe to merge the pull request without any other changes to it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, you didn't submitted the form, the HTML5 shows a green border only because the field is filled and not empty (because of the "required" html attribute).
This pull request is ready for merge, the buggy issues I was having was due to my environment, specifically with accessing the app on a unrecommended port, other than that everything looks good. I also checked the username with mastodon and it seems to work fine without issues, we are compatible with mastodon. Mastodon actually accepts spaces in their usernames too, but I don't think we should support spaces, just a longer length and dots, dashes, underscores is good enough. |
Please see my previous comments, mastodon accepts only : letters, numbers and underscores |
@rhaamo good point, yeah I never submitted it, 🤦♂️ I can see your comments now, I didn't see them before Also I was wrong about the length, they limit the username length at 30 chars I think it's too limiting on their end, we should create an issue and a pull request to fix that in their repo. They should also fix the frontend validation rules to not waste users time, in case when their take so long to pick a username and see all green to go then to just get denied and have to spend more time to pick their username within the limits. I've submitted an issue on the mastodon repo about this mastodon/mastodon#9346 Thanks @rhaamo I wasn't aware of that, I was away from this project for a month or so, not that I'm back yet, just wanted to do a checkup on the issues and comments etc. just been busy... |
! still some bug on the frontend complains but if you remove the disabled property it creates the account just fine (fixes #1263)