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

Make delete or downgrade team owners scale #1029

Merged
merged 45 commits into from
Apr 9, 2020

Conversation

fisx
Copy link
Contributor

@fisx fisx commented Mar 26, 2020

@fisx fisx force-pushed the fisx/delete-or-downgrade-team-owners branch from 3943f40 to 3e2e815 Compare March 26, 2020 16:03
@fisx fisx force-pushed the akshaymankar/count-team-members branch from 4a3872f to 01a114c Compare March 31, 2020 15:18
@fisx fisx force-pushed the fisx/delete-or-downgrade-team-owners branch 3 times, most recently from bf6271c to 2826c3a Compare April 2, 2020 09:35
@fisx fisx changed the base branch from akshaymankar/count-team-members to develop April 2, 2020 15:22
@fisx fisx force-pushed the fisx/delete-or-downgrade-team-owners branch from 290e230 to 4eb788d Compare April 2, 2020 15:22
@mheinzel mheinzel force-pushed the fisx/delete-or-downgrade-team-owners branch from 4eb788d to 66f4200 Compare April 7, 2020 17:47
mheinzel and others added 5 commits April 7, 2020 19:49
"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.
@@ -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
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

services/brig/src/Brig/API/User.hs Show resolved Hide resolved
Comment on lines 121 to 122
\ an owner. You must own the team to do that, and you must\
\ have an email address associated with your user."
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
\ 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."

Copy link
Contributor Author

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.

services/galley/src/Galley/API/Internal.hs Outdated Show resolved Hide resolved
@fisx fisx changed the title [WIP] Make delete or downgrade team owners scale Make delete or downgrade team owners scale Apr 8, 2020
@fisx fisx marked this pull request as ready for review April 8, 2020 13:36
fisx and others added 2 commits April 8, 2020 16:29
@fisx
Copy link
Contributor Author

fisx commented Apr 8, 2020

what changed in error labels?

  • when deleting /self (brig), "no-other-owner" changed to "no-self-delete-for-team-owner" (as its semantics also changed)
  • when deleting or downgrading a team member (galley / team settings), "no-other-owner" changed to the already existing "access-denied", since it only is thrown when an admin deletes an owner.

@mheinzel
Copy link
Contributor

mheinzel commented Apr 8, 2020

I added more tests, some of which failed because we didn't guard against an owner deleting (DELETE /teams/{tid}/members/{uid}) or demoting itself. This is fixed now.

@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)

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.

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

services/brig/src/Brig/API/Error.hs Outdated Show resolved Hide resolved
services/galley/src/Galley/API/Teams.hs Outdated Show resolved Hide resolved
services/galley/src/Galley/API/Teams.hs Show resolved Hide resolved
services/galley/src/Galley/Data.hs Outdated Show resolved Hide resolved
services/galley/test/integration/API/SQS.hs Show resolved Hide resolved
@fisx fisx merged commit 2ac9b8e into develop Apr 9, 2020
@fisx fisx deleted the fisx/delete-or-downgrade-team-owners branch April 9, 2020 11:06
@fisx fisx mentioned this pull request Apr 21, 2020
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

3 participants