lemmy-ui
lemmy-ui copied to clipboard
Sign up stalls when username is too long
Found a bug? Please fill out the sections below. 👍
For backend issues, use lemmy
Issue Summary
When you try to sign up and pick a username that is too long (I think 20 is the default max?) the sign up-button just starts spinning and then nothing more happens.
If you shorten your username it goes through without a glitch.
Feels like there should be an error thrown for usernames that are too long. I nosed around in the code a bit but I've never touched Rust before so I figure I'll leave it to someone who's more used to it. I did find a validator for it though in validators.rs:
pub fn is_valid_actor_name(name: &str, actor_name_max_length: usize) -> LemmyResult<()> { let check = name.chars().count() <= actor_name_max_length && VALID_ACTOR_NAME_REGEX.is_match(name) && !has_newline(name); if !check { Err(LemmyError::from_message("invalid_name")) } else { Ok(()) } }
Not sure why it's not triggering thoug, I'll let you guys sort that out.
Steps to Reproduce
- Fill in a long username, add a password and a comment for the spam filter, click submit (or whatever the button is called in English)
- Button keeps spinning
- No error message is shown
Technical details
I've also seen:
-
Signup hangs when you use an already existing username.
-
If the server admin turns off signup, the top right of the site still has a "Sign Up" link and the sigup page still presents a form to join - but hangs.
I was able to reproduce some bugs in the latest version 0.17.4
- When the password doesn't match, it keeps spinning without providing a response. (I received a response from the API indicating "passwords_dont_match")
- If the captcha is incorrect, it also keeps spinning without any response. (I received a response from the API indicating "captcha_incorrect")
- When a username is already in use, it returns a "502 Bad Gateway" error. The Lemmy log shows the following error message:
thread 'actix-rt|system:0|arbiter:5' panicked at 'couldn't create local user: DatabaseError(UniqueViolation, "duplicate key value violates unique constraint \"local_user_person_id_key\"")', crates/db_schema/src/impls/local_user.rs:157:8 - Similarly, if an email is already in use, it also returns a "502 Bad Gateway" error. The Lemmy log displays the following error message:
thread 'actix-rt|system:0|arbiter:4' panicked at 'couldn't create local user: DatabaseError(UniqueViolation, "duplicate key value violates unique constraint \"local_user_email_key\"")', crates/db_schema/src/impls/local_user.rs:157:8
There is a recent code pull request for login form crashes that seems similar to signup form problems: https://github.com/LemmyNet/lemmy-ui/pull/1305
@mkldn I think this issue is resolved as I now see an error message.
Can we close this?
Yeah, sounds about right then!
@mkldn you can close this issue. I don't have powers to.
Error message is shown, closing