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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suspend non-existing user should not create DB entry and return 404 #2267

Merged
merged 4 commits into from
Apr 11, 2022

Conversation

battermann
Copy link
Contributor

No description provided.

@battermann battermann temporarily deployed to cachix April 6, 2022 13:47 Inactive
@battermann battermann temporarily deployed to cachix April 6, 2022 14:37 Inactive
Comment on lines 344 to 348
updateStatus u s =
whenM (userExists u) $ retry x5 $ write userStatusUpdate (params LocalQuorum (s, u))
where
userExists :: MonadClient m => UserId -> m Bool
userExists uid = isJust <$> retry x1 (query1 idSelect (params LocalQuorum (Identity uid)))
Copy link
Member

Choose a reason for hiding this comment

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

Can you please make this throw a 404 when the user doesn't exist? Otherwise someone using the backoffice might think they did what was necessary when in reality it was a typo.

@battermann battermann temporarily deployed to cachix April 7, 2022 08:49 Inactive
@battermann battermann temporarily deployed to cachix April 7, 2022 08:55 Inactive
@battermann battermann changed the title update user status if exists Suspend non-existing user should not create DB entry and return 404 Apr 7, 2022
@battermann battermann requested a review from smatting April 7, 2022 14:35
Copy link
Member

@akshaymankar akshaymankar left a comment

Choose a reason for hiding this comment

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

Looks good, can you please add a changelog?

@battermann battermann temporarily deployed to cachix April 11, 2022 08:18 Inactive
@battermann battermann merged commit 8f46d78 into develop Apr 11, 2022
@battermann battermann deleted the leif/fix-suspend branch April 11, 2022 11: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.

None yet

2 participants