-
Notifications
You must be signed in to change notification settings - Fork 334
WPB-18190: Add route to delete collaborator from team #4694
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
Merged
blackheaven
merged 50 commits into
develop
from
gdifolco/WPB-18190_collaborator-delete-endpoint
Sep 24, 2025
Merged
Changes from all commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
4084173
WPB-18190: Add route to delete collaborator from team
blackheaven 586f331
add conversation drop
blackheaven cfead2e
debug
blackheaven 9571202
go through GalleyAPI
blackheaven f6955b3
filter then delete
blackheaven 0c35a6f
missing dependency
blackheaven 1bb0ac7
fix missing nix dependency
blackheaven f77061f
fix: remove O2O Conversations and remove users from others
blackheaven 0bc8ca5
refactor: split team quitting and user deletion
blackheaven f449c50
rely on Galley
blackheaven 120ca1b
fix: restore team collaborator removal
blackheaven 970e054
Update changelog.d/2-features/WPB-18190
blackheaven 26aec51
test: add multiple team & check get conv
blackheaven 51c3b60
fix: other connection test
blackheaven 7cdb9c7
test: add group conversation
blackheaven e6d1b3e
fix: drop Cassandra IN search
blackheaven 5f3bfbd
refactor: drop explicit queries
blackheaven 22221b6
feat: filter-out O2O connections
blackheaven 9b28702
fix: rebase
blackheaven 55cbe59
fix: missing parts
blackheaven b3e2b60
wip extend tests
battermann 0e4ba6a
Revert "wip extend tests"
blackheaven bff2966
fix: tests and correct conversation removal
blackheaven c572f53
fix: rebase
blackheaven c217801
fix: pass around changes to trigger notifications
blackheaven 869c0ab
fix: add tests assertions HasCallStack
blackheaven cc93c00
fix: could it finally work?
blackheaven a845443
fix: filter duplicated convs
blackheaven 0b1bc4a
fix: ormolu
blackheaven 2e08048
fix: comment
blackheaven f71e5e4
fix: ormolu
blackheaven d6c5c6f
fix: rebase
blackheaven 485bbcf
refactor: move to galley
blackheaven 8921bbc
fix: condition
blackheaven 87646c5
fix: endpoint is on galley now
blackheaven f9e0b31
fix: add forgot collaborator deletion
blackheaven 3614fb6
fix: add debug logs
blackheaven 97371d0
fix: ormolu
blackheaven 152359e
fix: add debug logs
blackheaven c3cc262
refactor: drop only conversations in teams
blackheaven 6be8485
fix: drop debug logs
blackheaven 5239163
fix: working
blackheaven c585a07
refactor: Leif feedback
blackheaven 14c857a
fix: send collaborator removal event to all members
blackheaven 8368ee6
refactor: code review
blackheaven 2c4b431
fix: ormolu
blackheaven c711d68
fix: drop canthrow
blackheaven a721475
fix: tests
blackheaven d8b1e27
fix: ormolu
blackheaven 9986c2f
Update libs/wire-api/src/Wire/API/Routes/Public/Galley/TeamMember.hs
blackheaven File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Allow collaborator to be removed from a team. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -125,6 +125,7 @@ data EventType | |||||
| | ConvDelete | ||||||
| | CollaboratorAdd | ||||||
| | AppCreate | ||||||
| | CollaboratorRemove | ||||||
| deriving stock (Eq, Show, Generic) | ||||||
| deriving (Arbitrary) via (GenericUniform EventType) | ||||||
| deriving (FromJSON, ToJSON, S.ToSchema) via Schema EventType | ||||||
|
|
@@ -142,7 +143,8 @@ instance ToSchema EventType where | |||||
| element "team.conversation-create" ConvCreate, | ||||||
| element "team.conversation-delete" ConvDelete, | ||||||
| element "team.collaborator-add" CollaboratorAdd, | ||||||
| element "team.app-create" AppCreate | ||||||
| element "team.app-create" AppCreate, | ||||||
| element "team.collaborator-remove" CollaboratorRemove | ||||||
| ] | ||||||
|
|
||||||
| -------------------------------------------------------------------------------- | ||||||
|
|
@@ -159,6 +161,7 @@ data EventData | |||||
| | EdConvDelete ConvId | ||||||
| | EdCollaboratorAdd UserId [CollaboratorPermission] | ||||||
| | EdAppCreate UserId | ||||||
| | EdCollaboratorRemove UserId | ||||||
| deriving stock (Eq, Show, Generic) | ||||||
|
|
||||||
| -- FUTUREWORK: this is outright wrong; see "Wire.API.Event.Conversation" on how to do this properly. | ||||||
|
|
@@ -189,6 +192,7 @@ instance ToJSON EventData where | |||||
| "permissions" A..= perms | ||||||
| ] | ||||||
| toJSON (EdAppCreate usr) = A.object ["user" A..= usr] | ||||||
| toJSON (EdCollaboratorRemove usr) = A.object ["user" A..= usr] | ||||||
|
|
||||||
| eventDataType :: EventData -> EventType | ||||||
| eventDataType (EdTeamCreate _) = TeamCreate | ||||||
|
|
@@ -201,6 +205,7 @@ eventDataType (EdConvCreate _) = ConvCreate | |||||
| eventDataType (EdConvDelete _) = ConvDelete | ||||||
| eventDataType (EdCollaboratorAdd _ _) = CollaboratorAdd | ||||||
| eventDataType (EdAppCreate _) = AppCreate | ||||||
| eventDataType (EdCollaboratorRemove _) = CollaboratorRemove | ||||||
|
|
||||||
| parseEventData :: EventType -> Maybe Value -> Parser EventData | ||||||
| parseEventData MemberJoin Nothing = fail "missing event data for type 'team.member-join'" | ||||||
|
|
@@ -215,11 +220,11 @@ parseEventData MemberLeave Nothing = fail "missing event data for type 'team.mem | |||||
| parseEventData MemberLeave (Just j) = do | ||||||
| let f o = EdMemberLeave <$> o .: "user" | ||||||
| withObject "member leave data" f j | ||||||
| parseEventData ConvCreate Nothing = fail "missing event data for type 'team.conversation-create" | ||||||
| parseEventData ConvCreate Nothing = fail "missing event data for type 'team.conversation-create'" | ||||||
| parseEventData ConvCreate (Just j) = do | ||||||
| let f o = EdConvCreate <$> o .: "conv" | ||||||
| withObject "conversation create data" f j | ||||||
| parseEventData ConvDelete Nothing = fail "missing event data for type 'team.conversation-delete" | ||||||
| parseEventData ConvDelete Nothing = fail "missing event data for type 'team.conversation-delete'" | ||||||
| parseEventData ConvDelete (Just j) = do | ||||||
| let f o = EdConvDelete <$> o .: "conv" | ||||||
| withObject "conversation delete data" f j | ||||||
|
|
@@ -235,6 +240,10 @@ parseEventData AppCreate Nothing = fail "missing event data for type 'team.app-c | |||||
| parseEventData AppCreate (Just j) = do | ||||||
| let f o = EdAppCreate <$> o .: "user" | ||||||
| withObject "app create data" f j | ||||||
| parseEventData CollaboratorRemove Nothing = fail "missing event data for type 'team.collaborator-remove" | ||||||
|
||||||
| parseEventData CollaboratorRemove Nothing = fail "missing event data for type 'team.collaborator-remove" | |
| parseEventData CollaboratorRemove Nothing = fail "missing event data for type 'team.collaborator-remove'" |
Contributor
Author
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.
fixed, thanks non-human.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
this is not sent, is it?
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.
added, thanks.