Skip to content
Closed
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/2-features/subconv-leave
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Implement endpoint for leaving a subconversation
Implement endpoint for leaving a subconversation (#2969, #3073)
34 changes: 18 additions & 16 deletions services/galley/test/integration/API/MLS.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2791,6 +2791,7 @@ testLeaveSubConv = do
(qsub, _) <- withTempMockFederator'
( receiveCommitMock [charlie1]
<|> welcomeMock
<|> ("on-mls-message-sent" ~> RemoteMLSMessageOk)
)
$ do
void $ createAddCommit alice1 [bob, charlie] >>= sendAndConsumeCommit
Expand All @@ -2805,22 +2806,23 @@ testLeaveSubConv = do
[bob1KP] <-
map snd . filter (\(cid, _) -> cid == bob1)
<$> getClientsFromGroupState alice1 bob
mlsBracket [alice1, bob2] $ \wss -> do
(_, reqs) <- withTempMockFederator' messageSentMock $ leaveCurrentConv bob1 qsub
req <-
assertOne
( toList . Aeson.decode . frBody
=<< filter ((== "on-mls-message-sent") . frRPC) reqs
)
let msg = fromBase64ByteString $ rmmMessage req
liftIO $
rmmRecipients req @?= [(ciUser charlie1, ciClient charlie1)]
consumeMessage1 charlie1 msg

msgs <-
WS.assertMatchN (5 # WS.Second) wss $
wsAssertBackendRemoveProposal bob qcnv bob1KP
traverse_ (uncurry consumeMessage1) (zip [alice1, bob2] msgs)
let allLocals = [alice1, bob1, bob2]
in mlsBracket allLocals $ \wss -> do
(_, reqs) <- withTempMockFederator' messageSentMock $ leaveCurrentConv bob1 qsub
req <-
assertOne
( toList . Aeson.decode . frBody
=<< filter ((== "on-mls-message-sent") . frRPC) reqs
)
let msg = fromBase64ByteString $ rmmMessage req
liftIO $
rmmRecipients req @?= [(ciUser charlie1, ciClient charlie1)]
consumeMessage1 charlie1 msg

msgs <-
WS.assertMatchN (5 # WS.Second) wss $
wsAssertBackendRemoveProposal bob qcnv bob1KP
traverse_ (uncurry consumeMessage1) (zip allLocals msgs)

-- alice commits the pending proposal
void $ createPendingProposalCommit alice1 >>= sendAndConsumeCommitBundle
Expand Down