Skip to content
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

If an admin searches for a user by email, don't crash if no user can be found #2295

Merged
merged 1 commit into from Nov 27, 2019

Conversation

roschaefer
Copy link
Contributor

@roschaefer roschaefer commented Nov 19, 2019

Ideally we would not have this inconsistent edge case that we filter
through the user type. Much better would be a graphql query like:

{
  User(filter: { primary_email: { email: "something@example.org" } }) {
    id
    name
    slug
  }
}

EDIT
I tried to implement the above behaviour and I think it's OK to have this edge case. Reason: you could nest _UserFilter indefinitely. So it becomes complex and risky to create a graphql-shield rule based on args.filter.primary_email.

Keeping it simple stupid and having this one inconsistency is OK I would say.

Fix #2294

Ideally we would not have this inconsistent edge case that we filter
through the user type. Much better would be a graphql query like:

```graphql
{
  User(filter: { primary_email: { email: "something@example.org" } }) {
    id
    name
    slug
  }
}
```
@roschaefer roschaefer requested a review from a team November 19, 2019 20:43
@roschaefer roschaefer self-assigned this Nov 19, 2019
@cypress
Copy link

cypress bot commented Nov 19, 2019



Test summary

48 0 0 0


Run details

Project Human-Connection
Status Passed
Commit dead263
Started Nov 19, 2019 8:44 PM
Ended Nov 19, 2019 8:58 PM
Duration 13:30 💡
OS Linux Ubuntu Linux - 16.04
Browser Chromium 78

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

Copy link
Member

@mattwr18 mattwr18 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry to keep saying the same thing, but I think that we cannot give a review on a PR with a title Fix #<issue_number>

  1. I don't know what issue 🐛 [Bug] Filter user by email leads to 500 error if email can't be found #2294 fixes, which means instead of the PR creator taking an extra minute to update the title with something meaningful, you are asking the PR reviewer to take their time to figure out what issue the PR solves.
  2. sometimes I don't have time to give an actual review, but would like a high-level overview of what issue the PR addresses
  3. and maybe most importantly, when we create our changelog and release, this PR, if merged like so, will only appear as Fix #2294, which again means the people helping to manually test the new features/bug fixes will need to spend their time to figure out what they need to be testing.

Please, update the title accordingly, and I'll be happy to give time and attention to reviewing this PR.
Thanks ;)

@roschaefer roschaefer changed the title Fix #2294 If an admin searches for a user by email, don't crash if no user can be found Nov 22, 2019
@roschaefer
Copy link
Contributor Author

@mattwr18 is that better?

@mattwr18
Copy link
Member

great @roschaefer !! I'll give this a review now 😸

Copy link
Member

@mattwr18 mattwr18 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job!!

@mattwr18 mattwr18 merged commit 62080a0 into master Nov 27, 2019
@mattwr18 mattwr18 deleted the 2294_fix_email_filter branch November 27, 2019 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 [Bug] Filter user by email leads to 500 error if email can't be found
2 participants