From fbd5db25bf7cb23ff1ee502d02a410be38f1e50e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Dimja=C5=A1evi=C4=87?= Date: Mon, 15 Apr 2024 10:06:06 +0200 Subject: [PATCH 1/4] Test: confirm the bug from the report --- integration/test/Test/MLS/One2One.hs | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/integration/test/Test/MLS/One2One.hs b/integration/test/Test/MLS/One2One.hs index aac9725d9c9..8c6ce11355d 100644 --- a/integration/test/Test/MLS/One2One.hs +++ b/integration/test/Test/MLS/One2One.hs @@ -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 From 063a2744ae56bcdb0dc5d35d39607a1bdf96600a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Dimja=C5=A1evi=C4=87?= Date: Mon, 15 Apr 2024 10:06:14 +0200 Subject: [PATCH 2/4] Return the list of other members in MLS 1-to-1 --- services/galley/src/Galley/API/MLS/One2One.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/galley/src/Galley/API/MLS/One2One.hs b/services/galley/src/Galley/API/MLS/One2One.hs index c194d72302e..f0632f737c5 100644 --- a/services/galley/src/Galley/API/MLS/One2One.hs +++ b/services/galley/src/Galley/API/MLS/One2One.hs @@ -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), From 7ef676acb21c921faa51dc0d5feb023c5e6ef80f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Dimja=C5=A1evi=C4=87?= Date: Mon, 15 Apr 2024 10:06:26 +0200 Subject: [PATCH 3/4] Add a changelog --- changelog.d/3-bug-fixes/WPB-7415 | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/3-bug-fixes/WPB-7415 diff --git a/changelog.d/3-bug-fixes/WPB-7415 b/changelog.d/3-bug-fixes/WPB-7415 new file mode 100644 index 00000000000..ca4c5a1dd24 --- /dev/null +++ b/changelog.d/3-bug-fixes/WPB-7415 @@ -0,0 +1 @@ +Return an actual list of other users in a remote MLS 1-to-1 conversation From e75c3f3e79ea0a9c965e1700e16f06073d96376a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Dimja=C5=A1evi=C4=87?= Date: Mon, 15 Apr 2024 10:36:12 +0200 Subject: [PATCH 4/4] Hi CI