Skip to content
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
1 change: 1 addition & 0 deletions changelog.d/3-bug-fixes/WPB-7415
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Return an actual list of other users in a remote MLS 1-to-1 conversation
33 changes: 33 additions & 0 deletions integration/test/Test/MLS/One2One.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,39 @@ testGetMLSOne2One otherDomain = do
conv2 %. "qualified_id" `shouldMatch` convId
conv2 %. "epoch" `shouldMatch` (conv %. "epoch")

testMLSOne2OneOtherMember :: HasCallStack => One2OneScenario -> App ()
testMLSOne2OneOtherMember scenario = do
alice <- randomUser OwnDomain def
let otherDomain = one2OneScenarioUserDomain scenario
convDomain = one2OneScenarioConvDomain scenario
bob <- createMLSOne2OnePartner otherDomain alice convDomain
conv <- getMLSOne2OneConversation alice bob >>= getJSON 200
do
convId <- conv %. "qualified_id"
bobConv <- getMLSOne2OneConversation bob alice >>= getJSON 200
convId `shouldMatch` (bobConv %. "qualified_id")

[alice1, bob1] <- traverse (createMLSClient def) [alice, bob]
traverse_ uploadNewKeyPackage [bob1]
resetGroup alice1 conv
withWebSocket bob1 $ \ws -> do
commit <- createAddCommit alice1 [bob]
void $ sendAndConsumeCommitBundle commit
let isMessage n = nPayload n %. "type" `isEqual` "conversation.mls-welcome"
n <- awaitMatch isMessage ws
nPayload n %. "data" `shouldMatch` B8.unpack (Base64.encode (fold commit.welcome))

-- Make sure the membership info is OK both for the MLS 1-to-1 endpoint and
-- for the general conversation fetching endpoint.
let assertOthers other resp = do
bdy <- getJSON 200 resp
othersObj <- bdy %. "members.others" & asList
otherActual <- assertOne othersObj
otherActual %. "qualified_id" `shouldMatch` (other %. "qualified_id")
forM_ [(alice, bob), (bob, alice)] $ \(self, other) -> do
getMLSOne2OneConversation self other `bindResponse` assertOthers other
getConversation self conv `bindResponse` assertOthers other

testGetMLSOne2OneUnconnected :: HasCallStack => Domain -> App ()
testGetMLSOne2OneUnconnected otherDomain = do
[alice, bob] <- for [OwnDomain, otherDomain] $ \domain -> randomUser domain def
Expand Down
2 changes: 1 addition & 1 deletion services/galley/src/Galley/API/MLS/One2One.hs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ remoteMLSOne2OneConversation lself rother rc =
let members =
ConvMembers
{ cmSelf = defMember (tUntagged lself),
cmOthers = []
cmOthers = rc.members.others
}
in Conversation
{ cnvQualifiedId = tUntagged (qualifyAs rother rc.id),
Expand Down