Skip to content

Owner invite doesn't work when username is specified with different casing #2081

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

Closed
YaLTeR opened this issue Dec 30, 2019 · 4 comments · Fixed by #2194
Closed

Owner invite doesn't work when username is specified with different casing #2081

YaLTeR opened this issue Dec 30, 2019 · 4 comments · Fixed by #2194
Labels

Comments

@YaLTeR
Copy link

YaLTeR commented Dec 30, 2019

I'm trying to invite https://crates.io/users/matherunner to my crate https://crates.io/crates/hltas. I tried adding Matherunner, matherunner as well as his email address, multiple times, always getting "An invite has been sent to matherunner". However, he never got any emails and his owner invites are empty.

Implementation instructions

  • Start from this branch that has a test that fails because the username of the invited owner is specified in a different case than it is in the database.
  • Get the test to pass by changing this filter to be case insensitive using the crate::lower function like this code does (I'm not sure why that code chooses to lowercase the provided name in Rust and then use the SQL crate::lower function on the gh_login... I think both should be done with SQL in this case?) We have an index on lower(gh_login) so this query will be fast.
@carols10cents
Copy link
Member

carols10cents commented Jan 1, 2020

I'm sorry this isn't working! I indeed don't see any invitations created by you for the hltas crate.

I tried inviting someone to one of my crates in the web UI, so invitations works in general.

I tried inviting matherunner and that didn't create an invitation, but inviting Matherunner did-- so I think we have a bug where we're not comparing the names case-insensitively.

I'm not sure why Matherunner didn't work for you-- is there any chance there was whitespace around the name? (We should be removing that if that's the case)

Can you try inviting them from the commandline, with cargo owner -a Matherunner hltas ?

We also have a bug that we're not reporting when and why invitations fail 😰 I looked in the logs for your requests and they all had status 200.

@YaLTeR
Copy link
Author

YaLTeR commented Jan 1, 2020

I tried inviting matherunner and that didn't create an invitation, but inviting Matherunner did-- so I think we have a bug where we're not comparing the names case-insensitively.

I'm not sure why Matherunner didn't work for you-- is there any chance there was whitespace around the name? (We should be removing that if that's the case)

Ah, it might be the case that I tried inviting with the capital first letter only before he has logged into crates.io for the first time, and only with the lowercase first letter afterwards. I tried inviting with the capital first letter again now.

@YaLTeR
Copy link
Author

YaLTeR commented Jan 1, 2020

Looks like that worked!

@carols10cents
Copy link
Member

carols10cents commented Jan 1, 2020

Great! I'm going to make this issue about the case problem and create some more issues for the other problems. Sorry this was such trouble, and thank you for reporting this so we can fix it!

@carols10cents carols10cents changed the title Owner invite doesn't work Owner invite doesn't work when username is specified with different casing Jan 1, 2020
@bors bors closed this as completed in c69faed Dec 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants