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

[WPB-6144] Don't remove MLS clients from a 1-1 conversation #3906

Merged
merged 2 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion changelog.d/3-bug-fixes/wpb-6144-messaging-blocked-user
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Do not deliver MLS one-to-one conversation messages to a user that blocked the sender
Do not deliver MLS one-to-one conversation messages to a user that blocked the sender (#3889, #3906)
6 changes: 0 additions & 6 deletions services/galley/src/Galley/API/One2One.hs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import Galley.Types.UserList
import Imports
import Polysemy
import Wire.API.Conversation hiding (Member)
import Wire.API.Conversation.Protocol
import Wire.API.Routes.Internal.Galley.ConversationsIntra
import Wire.API.User

Expand Down Expand Up @@ -86,11 +85,6 @@ iUpsertOne2OneConversation UpsertOne2OneConversationRequest {..} = do
deleteMembers
(tUnqualified lconvId)
(UserList [tUnqualified uooLocalUser] [])
let mGroupId = case convProtocol conv of
ProtocolProteus -> Nothing
ProtocolMLS meta -> Just . cnvmlsGroupId $ meta
ProtocolMixed meta -> Just . cnvmlsGroupId $ meta
for_ mGroupId $ flip removeAllMLSClientsOfUser (tUntagged uooLocalUser)
(RemoteActor, Included) -> do
void $ createMembers (tUnqualified lconvId) (UserList [] [uooRemoteUser])
unless (null (convLocalMembers conv)) $
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,11 +384,6 @@ removeMLSClients groupId (Qualified usr domain) cs = retry x5 . batch $ do
for_ cs $ \c ->
addPrepQuery Cql.removeMLSClient (groupId, domain, usr, c)

removeAllMLSClientsOfUser :: GroupId -> Qualified UserId -> Client ()
removeAllMLSClientsOfUser groupId (Qualified usr domain) =
retry x5 $
write Cql.removeAllMLSClientsOfUser (params LocalQuorum (groupId, domain, usr))

removeAllMLSClients :: GroupId -> Client ()
removeAllMLSClients groupId = do
retry x5 $ write Cql.removeAllMLSClients (params LocalQuorum (Identity groupId))
Expand Down Expand Up @@ -421,7 +416,6 @@ interpretMemberStoreToCassandra = interpret $ \case
AddMLSClients lcnv quid cs -> embedClient $ addMLSClients lcnv quid cs
PlanClientRemoval lcnv cids -> embedClient $ planMLSClientRemoval lcnv cids
RemoveMLSClients lcnv quid cs -> embedClient $ removeMLSClients lcnv quid cs
RemoveAllMLSClientsOfUser lcnv quid -> embedClient $ removeAllMLSClientsOfUser lcnv quid
RemoveAllMLSClients gid -> embedClient $ removeAllMLSClients gid
LookupMLSClients lcnv -> embedClient $ lookupMLSClients lcnv
LookupMLSClientLeafIndices lcnv -> embedClient $ lookupMLSClientLeafIndices lcnv
Expand Down
3 changes: 0 additions & 3 deletions services/galley/src/Galley/Cassandra/Queries.hs
Original file line number Diff line number Diff line change
Expand Up @@ -493,9 +493,6 @@ planMLSClientRemoval = "update mls_group_member_client set removal_pending = tru
removeMLSClient :: PrepQuery W (GroupId, Domain, UserId, ClientId) ()
removeMLSClient = "delete from mls_group_member_client where group_id = ? and user_domain = ? and user = ? and client = ?"

removeAllMLSClientsOfUser :: PrepQuery W (GroupId, Domain, UserId) ()
removeAllMLSClientsOfUser = "delete from mls_group_member_client where group_id = ? and user_domain = ? and user = ?"

removeAllMLSClients :: PrepQuery W (Identity GroupId) ()
removeAllMLSClients = "DELETE FROM mls_group_member_client WHERE group_id = ?"

Expand Down
2 changes: 0 additions & 2 deletions services/galley/src/Galley/Effects/MemberStore.hs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ module Galley.Effects.MemberStore
addMLSClients,
planClientRemoval,
removeMLSClients,
removeAllMLSClientsOfUser,
removeAllMLSClients,
lookupMLSClients,
lookupMLSClientLeafIndices,
Expand Down Expand Up @@ -89,7 +88,6 @@ data MemberStore m a where
AddMLSClients :: GroupId -> Qualified UserId -> Set (ClientId, LeafIndex) -> MemberStore m ()
PlanClientRemoval :: Foldable f => GroupId -> f ClientIdentity -> MemberStore m ()
RemoveMLSClients :: GroupId -> Qualified UserId -> Set ClientId -> MemberStore m ()
RemoveAllMLSClientsOfUser :: GroupId -> Qualified UserId -> MemberStore m ()
RemoveAllMLSClients :: GroupId -> MemberStore m ()
LookupMLSClients :: GroupId -> MemberStore m ClientMap
LookupMLSClientLeafIndices :: GroupId -> MemberStore m (ClientMap, IndexMap)
Expand Down
Loading