-
Notifications
You must be signed in to change notification settings - Fork 326
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
Make delete or downgrade team owners scale #1029
Conversation
3943f40
to
3e2e815
Compare
4a3872f
to
01a114c
Compare
bf6271c
to
2826c3a
Compare
290e230
to
4eb788d
Compare
4eb788d
to
66f4200
Compare
"aeson half-roundtrip" was broken because it relied on ordering of fields, which is not guaranteed in JSON. There were also two redundant "aeson roundtrip" tests, so I removed one.
services/brig/src/Brig/API/User.hs
Outdated
@@ -745,20 +744,10 @@ deleteUser uid pwd = do | |||
Nothing -> throwE DeleteUserInvalid | |||
Just a -> case accountStatus a of | |||
Deleted -> return Nothing | |||
Suspended -> ensureNotOnlyOwner account >> go a | |||
Active -> ensureNotOnlyOwner account >> go a | |||
Suspended -> go a |
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.
we might still want to prevent owners from deleting themselves. Ending up with an owner without email address is not a big deal, but no owner at all seems problematic.
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.
\ an owner. You must own the team to do that, and you must\ | ||
\ have an email address associated with your user." |
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.
\ an owner. You must own the team to do that, and you must\ | |
\ have an email address associated with your user." | |
\ an owner. You must be an owner of the team yourself to do that." |
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.
should be resolve by 8b4f360.
Co-Authored-By: Matthias Heinzel <mheinzel@posteo.de>
what changed in error labels?
|
This reverts commit 4aa7dd2.
we don't prevent owners to remove themselves
we don't prevent owners from demoting themselves
I added more tests, some of which failed because we didn't guard against an owner deleting ( @fisx Please have a look at my changes tomorrow and merge if you're happy with them. (I also had some search-related tests fail, but they seem unrelated, so I hope it's just a local thing and they'll pass in CI) |
This reverts commit 62d8505.
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 think we shouldn't tackle fanout and billing problems in this PR. Apart from from that minor nitpicks.
PS: We're going to have fun merging this and #1046
This is to be taken care of in these issues later: zinfra/backend-issues#1296 zinfra/backend-issues#1240
https://github.com/zinfra/backend-issues/issues/1237