From 8c5387026f2862d218cd9a387aff03e32eb0ed27 Mon Sep 17 00:00:00 2001 From: Stefan Matting Date: Tue, 27 Dec 2022 08:13:10 +0100 Subject: [PATCH 01/10] Add get-sub-conversation endpoint type --- .../src/Wire/API/Federation/API/Galley.hs | 15 +++++++++++++++ libs/wire-api/src/Wire/API/MLS/SubConversation.hs | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/libs/wire-api-federation/src/Wire/API/Federation/API/Galley.hs b/libs/wire-api-federation/src/Wire/API/Federation/API/Galley.hs index 2166f915c5a..9ef47081b3b 100644 --- a/libs/wire-api-federation/src/Wire/API/Federation/API/Galley.hs +++ b/libs/wire-api-federation/src/Wire/API/Federation/API/Galley.hs @@ -75,6 +75,7 @@ type GalleyApi = :<|> FedEndpoint "query-group-info" GetGroupInfoRequest GetGroupInfoResponse :<|> FedEndpoint "on-client-removed" ClientRemovedRequest EmptyResponse :<|> FedEndpoint "on-typing-indicator-updated" TypingDataUpdateRequest EmptyResponse + :<|> FedEndpoint "get-sub-conversation" GetSubConversationsRequest GetSubConversationsResponse data TypingDataUpdateRequest = TypingDataUpdateRequest { tdurTypingStatus :: TypingStatus, @@ -367,3 +368,17 @@ data GetGroupInfoResponse | GetGroupInfoResponseState Base64ByteString deriving stock (Eq, Show, Generic) deriving (ToJSON, FromJSON) via (CustomEncoded GetGroupInfoResponse) + +data GetSubConversationsRequest = GetSubConversationsRequest + { gsreqUser :: UserId, + gsreqConv :: ConvId, + gsreqSubConv :: SubConvId + } + deriving stock (Eq, Show, Generic) + deriving (ToJSON, FromJSON) via (CustomEncoded GetSubConversationsRequest) + +data GetSubConversationsResponse + = GetSubConversationsResponseError GalleyError + | GetSubConversationsResponseSuccess PublicSubConversation + deriving stock (Eq, Show, Generic) + deriving (ToJSON, FromJSON) via (CustomEncoded GetSubConversationsResponse) diff --git a/libs/wire-api/src/Wire/API/MLS/SubConversation.hs b/libs/wire-api/src/Wire/API/MLS/SubConversation.hs index 10e79f727b7..09a77b89a13 100644 --- a/libs/wire-api/src/Wire/API/MLS/SubConversation.hs +++ b/libs/wire-api/src/Wire/API/MLS/SubConversation.hs @@ -46,7 +46,7 @@ import Wire.Arbitrary -- conversation. The pair of a qualified conversation ID and a subconversation -- ID identifies globally. newtype SubConvId = SubConvId {unSubConvId :: Text} - deriving newtype (Eq, ToSchema, Ord, S.ToParamSchema, ToByteString) + deriving newtype (Eq, ToSchema, Ord, S.ToParamSchema, ToByteString, ToJSON, FromJSON) deriving stock (Generic) deriving (Arbitrary) via (GenericUniform SubConvId) deriving stock (Show) From 14e88ba8ca1958c87729dbc0de8f8f811c779281 Mon Sep 17 00:00:00 2001 From: Stefan Matting Date: Tue, 27 Dec 2022 09:12:55 +0100 Subject: [PATCH 02/10] Refactor: Generalize getConversationAndCheckMembership --- .../src/Galley/API/MLS/SubConversation.hs | 2 +- services/galley/src/Galley/API/Query.hs | 4 +-- services/galley/src/Galley/API/Util.hs | 29 ++++++++++++++----- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/services/galley/src/Galley/API/MLS/SubConversation.hs b/services/galley/src/Galley/API/MLS/SubConversation.hs index dfc0234b55b..357be672847 100644 --- a/services/galley/src/Galley/API/MLS/SubConversation.hs +++ b/services/galley/src/Galley/API/MLS/SubConversation.hs @@ -84,7 +84,7 @@ getLocalSubConversation :: SubConvId -> Sem r PublicSubConversation getLocalSubConversation lusr lconv sconv = do - c <- getConversationAndCheckMembership (tUnqualified lusr) lconv + c <- getConversationAndCheckMembership (tUntagged lusr) lconv unless (Data.convType c == RegularConv) $ throwS @'MLSSubConvUnsupportedConvType diff --git a/services/galley/src/Galley/API/Query.hs b/services/galley/src/Galley/API/Query.hs index 99fdf91f88e..4e93d5839d7 100644 --- a/services/galley/src/Galley/API/Query.hs +++ b/services/galley/src/Galley/API/Query.hs @@ -136,7 +136,7 @@ getUnqualifiedConversation :: ConvId -> Sem r Public.Conversation getUnqualifiedConversation lusr cnv = do - c <- getConversationAndCheckMembership (tUnqualified lusr) (qualifyAs lusr cnv) + c <- getConversationAndCheckMembership (tUntagged lusr) (qualifyAs lusr cnv) Mapping.conversationView lusr c getConversation :: @@ -272,7 +272,7 @@ getConversationRoles :: ConvId -> Sem r Public.ConversationRolesList getConversationRoles lusr cnv = do - void $ getConversationAndCheckMembership (tUnqualified lusr) (qualifyAs lusr cnv) + void $ getConversationAndCheckMembership (tUntagged lusr) (qualifyAs lusr cnv) -- NOTE: If/when custom roles are added, these roles should -- be merged with the team roles (if they exist) pure $ Public.ConversationRolesList wireConvRoles diff --git a/services/galley/src/Galley/API/Util.hs b/services/galley/src/Galley/API/Util.hs index 305226946cc..3e99373a74b 100644 --- a/services/galley/src/Galley/API/Util.hs +++ b/services/galley/src/Galley/API/Util.hs @@ -502,16 +502,29 @@ getMember p u = noteS @e . find ((u ==) . p) getConversationAndCheckMembership :: Members '[ConversationStore, ErrorS 'ConvNotFound, ErrorS 'ConvAccessDenied] r => - UserId -> + Qualified UserId -> Local ConvId -> Sem r Data.Conversation -getConversationAndCheckMembership uid lcnv = do - (conv, _) <- - getConversationAndMemberWithError - @'ConvAccessDenied - uid - lcnv - pure conv +getConversationAndCheckMembership quid lcnv = do + foldQualified + lcnv + ( \lusr -> do + (conv, _) <- + getConversationAndMemberWithError + @'ConvAccessDenied + (tUnqualified lusr) + lcnv + pure conv + ) + ( \rusr -> do + (conv, _) <- + getConversationAndMemberWithError + @'ConvNotFound + rusr + lcnv + pure conv + ) + quid getConversationWithError :: ( Member ConversationStore r, From e34e5e042e218602cb51ae7826e3785dc707bb77 Mon Sep 17 00:00:00 2001 From: Stefan Matting Date: Tue, 27 Dec 2022 10:31:09 +0100 Subject: [PATCH 03/10] Add federation and generalize client endpoint --- services/galley/src/Galley/API/Federation.hs | 21 +++++++ .../src/Galley/API/MLS/SubConversation.hs | 60 ++++++++++++++++--- 2 files changed, 74 insertions(+), 7 deletions(-) diff --git a/services/galley/src/Galley/API/Federation.hs b/services/galley/src/Galley/API/Federation.hs index e18f660c444..b07a738c468 100644 --- a/services/galley/src/Galley/API/Federation.hs +++ b/services/galley/src/Galley/API/Federation.hs @@ -120,6 +120,7 @@ federationSitemap = :<|> Named @"query-group-info" queryGroupInfo :<|> Named @"on-client-removed" onClientRemoved :<|> Named @"on-typing-indicator-updated" onTypingIndicatorUpdated + :<|> Named @"get-sub-conversation" getSubConversationForRemoteUser onClientRemoved :: ( Members @@ -847,3 +848,23 @@ onTypingIndicatorUpdated origDomain TypingDataUpdateRequest {..} = do runError @(Tagged 'ConvNotFound ()) $ isTyping qusr Nothing lcnv tdurTypingStatus pure EmptyResponse + +getSubConversationForRemoteUser :: + Members + '[ SubConversationStore, + ConversationStore, + Error InternalError, + P.TinyLog + ] + r => + Domain -> + GetSubConversationsRequest -> + Sem r GetSubConversationsResponse +getSubConversationForRemoteUser domain GetSubConversationsRequest {..} = + fmap (either F.GetSubConversationsResponseError F.GetSubConversationsResponseSuccess) + . runError @GalleyError + . mapToGalleyError @MLSGetSubConvStaticErrors + $ do + let qusr = Qualified gsreqUser domain + let lconv = toLocalUnsafe domain gsreqConv + getLocalSubConversation qusr lconv gsreqSubConv diff --git a/services/galley/src/Galley/API/MLS/SubConversation.hs b/services/galley/src/Galley/API/MLS/SubConversation.hs index 357be672847..c208a66ec61 100644 --- a/services/galley/src/Galley/API/MLS/SubConversation.hs +++ b/services/galley/src/Galley/API/MLS/SubConversation.hs @@ -29,6 +29,7 @@ import Galley.App (Env) import qualified Galley.Data.Conversation as Data import Galley.Data.Conversation.Types import Galley.Effects +import Galley.Effects.FederatorAccess import Galley.Effects.SubConversationStore import qualified Galley.Effects.SubConversationStore as Eff import Imports @@ -41,10 +42,18 @@ import Wire.API.Conversation import Wire.API.Conversation.Protocol import Wire.API.Error import Wire.API.Error.Galley -import Wire.API.Federation.Error (FederationError, federationNotImplemented) +import Wire.API.Federation.API (Component (Galley), fedClient) +import Wire.API.Federation.API.Galley (GetSubConversationsRequest (..), GetSubConversationsResponse (..)) +import Wire.API.Federation.Error (FederationError) import Wire.API.MLS.PublicGroupState import Wire.API.MLS.SubConversation +type MLSGetSubConvStaticErrors = + '[ ErrorS 'ConvNotFound, + ErrorS 'ConvAccessDenied, + ErrorS 'MLSSubConvUnsupportedConvType + ] + getSubConversation :: Members '[ SubConversationStore, @@ -53,7 +62,9 @@ getSubConversation :: ErrorS 'ConvAccessDenied, ErrorS 'MLSSubConvUnsupportedConvType, Error InternalError, + Error FederationError, Error Wai.Error, + FederatorAccess, P.TinyLog ] r => @@ -64,8 +75,8 @@ getSubConversation :: getSubConversation lusr qconv sconv = do foldQualified lusr - (\lcnv -> getLocalSubConversation lusr lcnv sconv) - (\_rcnv -> throw federationNotImplemented) + (\lcnv -> getLocalSubConversation (tUntagged lusr) lcnv sconv) + (\rcnv -> getRemoteSubConversation lusr rcnv sconv) qconv getLocalSubConversation :: @@ -79,12 +90,12 @@ getLocalSubConversation :: P.TinyLog ] r => - Local UserId -> + Qualified UserId -> Local ConvId -> SubConvId -> Sem r PublicSubConversation -getLocalSubConversation lusr lconv sconv = do - c <- getConversationAndCheckMembership (tUntagged lusr) lconv +getLocalSubConversation qusr lconv sconv = do + c <- getConversationAndCheckMembership qusr lconv unless (Data.convType c == RegularConv) $ throwS @'MLSSubConvUnsupportedConvType @@ -114,7 +125,42 @@ getLocalSubConversation lusr lconv sconv = do } pure sub Just sub -> pure sub - pure (toPublicSubConv (tUntagged (qualifyAs lusr sub))) + pure (toPublicSubConv (tUntagged (qualifyAs lconv sub))) + +getRemoteSubConversation :: + forall r. + ( Members + '[ SubConversationStore, + ConversationStore, + ErrorS 'ConvNotFound, + ErrorS 'ConvAccessDenied, + ErrorS 'MLSSubConvUnsupportedConvType, + Error InternalError, + Error FederationError, + FederatorAccess, + P.TinyLog + ] + r, + Members MLSGetSubConvStaticErrors r, + RethrowErrors MLSGetSubConvStaticErrors r + ) => + Local UserId -> + Remote ConvId -> + SubConvId -> + Sem r PublicSubConversation +getRemoteSubConversation lusr rcnv sconv = do + res <- runFederated rcnv $ do + fedClient @'Galley @"get-sub-conversation" $ + GetSubConversationsRequest + { gsreqUser = tUnqualified lusr, + gsreqConv = tUnqualified rcnv, + gsreqSubConv = sconv + } + case res of + GetSubConversationsResponseError err -> + rethrowErrors @MLSGetSubConvStaticErrors @r err + GetSubConversationsResponseSuccess subconv -> + pure subconv getSubConversationGroupInfo :: Members From f035c8f991004140425209592fc9f82bd8c6fd1b Mon Sep 17 00:00:00 2001 From: Stefan Matting Date: Tue, 27 Dec 2022 10:45:40 +0100 Subject: [PATCH 04/10] Int. test: local member, remote subconversation --- services/galley/test/integration/API/MLS.hs | 62 ++++++++++++++++++--- 1 file changed, 53 insertions(+), 9 deletions(-) diff --git a/services/galley/test/integration/API/MLS.hs b/services/galley/test/integration/API/MLS.hs index b8758cc984f..bba931e5f96 100644 --- a/services/galley/test/integration/API/MLS.hs +++ b/services/galley/test/integration/API/MLS.hs @@ -61,6 +61,7 @@ import Wire.API.Conversation.Role import Wire.API.Error.Galley import Wire.API.Federation.API.Common import Wire.API.Federation.API.Galley +import Wire.API.MLS.CipherSuite import Wire.API.MLS.Credential import Wire.API.MLS.Keys import Wire.API.MLS.Serialisation @@ -207,15 +208,23 @@ tests s = ], testGroup "SubConversation" - [ test s "get subconversation of MLS conv - 200" (testCreateSubConv True), - test s "get subconversation of Proteus conv - 404" (testCreateSubConv False), - test s "join subconversation with an external commit bundle" testJoinSubConv, - test s "join subconversation with a client that is not in the main conv" testJoinSubNonMemberClient, - test s "add another client to a subconversation" testAddClientSubConv, - test s "remove another client from a subconversation" testRemoveClientSubConv, - test s "join remote subconversation" testJoinRemoteSubConv, - test s "client of a remote user joins subconversation" testRemoteUserJoinSubConv, - test s "send an application message in a subconversation" testSendMessageSubConv + [ testGroup + "Local Sender/Local Subconversation" + [ test s "get subconversation of MLS conv - 200" (testCreateSubConv True), + test s "get subconversation of Proteus conv - 404" (testCreateSubConv False), + test s "join subconversation with an external commit bundle" testJoinSubConv, + test s "join subconversation with a client that is not in the main conv" testJoinSubNonMemberClient, + test s "add another client to a subconversation" testAddClientSubConv, + test s "remove another client from a subconversation" testRemoveClientSubConv, + test s "client of a remote user joins subconversation" testRemoteUserJoinSubConv, + test s "send an application message in a subconversation" testSendMessageSubConv + ], + testGroup + "Local Sender/Remote Subconversation" + [ test s "get subconversation of remote conversation - member" (testGetRemoteSubConv True), + test s "get subconversation of remote conversation - not member" (testGetRemoteSubConv False), + test s "join remote subconversation" testJoinRemoteSubConv + ] ] ] @@ -2383,3 +2392,38 @@ testSendMessageSubConv = do liftIO $ WS.assertMatchN_ (5 # WS.Second) wss $ \n -> do wsAssertMLSMessage qcs alice (mpMessage message) n + +testGetRemoteSubConv :: Bool -> TestM () +testGetRemoteSubConv isAMember = do + alice <- randomQualifiedUser + let remoteDomain = Domain "faraway.example.com" + conv <- randomId + let qconv = Qualified conv remoteDomain + sconv = SubConvId "conference" + fakeSubConv = + PublicSubConversation + { pscParentConvId = qconv, + pscSubConvId = sconv, + pscGroupId = GroupId "deadbeef", + pscEpoch = Epoch 0, + pscCipherSuite = MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519, + pscMembers = [] + } + + let mock req = case frRPC req of + "get-sub-conversation" -> + pure $ + if isAMember + then Aeson.encode (GetSubConversationsResponseSuccess fakeSubConv) + else Aeson.encode (GetSubConversationsResponseError ConvNotFound) + rpc -> assertFailure $ "unmocked RPC called: " <> T.unpack rpc + + (_, reqs) <- + withTempMockFederator' mock $ + getSubConv (qUnqualified alice) qconv sconv + Date: Tue, 27 Dec 2022 12:28:39 +0100 Subject: [PATCH 05/10] Fix bug: conversation qualified wrong --- services/galley/src/Galley/API/Federation.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/galley/src/Galley/API/Federation.hs b/services/galley/src/Galley/API/Federation.hs index b07a738c468..20ab7e727be 100644 --- a/services/galley/src/Galley/API/Federation.hs +++ b/services/galley/src/Galley/API/Federation.hs @@ -853,6 +853,7 @@ getSubConversationForRemoteUser :: Members '[ SubConversationStore, ConversationStore, + Input (Local ()), Error InternalError, P.TinyLog ] @@ -866,5 +867,5 @@ getSubConversationForRemoteUser domain GetSubConversationsRequest {..} = . mapToGalleyError @MLSGetSubConvStaticErrors $ do let qusr = Qualified gsreqUser domain - let lconv = toLocalUnsafe domain gsreqConv + lconv <- qualifyLocal gsreqConv getLocalSubConversation qusr lconv gsreqSubConv From 058f03119b29dbde65e112c7d5fb10ef1b0f40be Mon Sep 17 00:00:00 2001 From: Stefan Matting Date: Tue, 27 Dec 2022 12:37:23 +0100 Subject: [PATCH 06/10] Add tests for federation endpoint --- services/galley/test/integration/API/MLS.hs | 68 +++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/services/galley/test/integration/API/MLS.hs b/services/galley/test/integration/API/MLS.hs index bba931e5f96..599615585a6 100644 --- a/services/galley/test/integration/API/MLS.hs +++ b/services/galley/test/integration/API/MLS.hs @@ -224,6 +224,11 @@ tests s = [ test s "get subconversation of remote conversation - member" (testGetRemoteSubConv True), test s "get subconversation of remote conversation - not member" (testGetRemoteSubConv False), test s "join remote subconversation" testJoinRemoteSubConv + ], + testGroup + "Remote Sender/Local SubConversation" + [ test s "get subconversation as a remote member" (testRemoteMemberGetSubConv True), + test s "get subconversation as a remote non-member" (testRemoteMemberGetSubConv False) ] ] ] @@ -2427,3 +2432,66 @@ testGetRemoteSubConv isAMember = do liftIO $ req @?= Just (GetSubConversationsRequest (qUnqualified alice) conv sconv) + +testRemoteMemberGetSubConv :: Bool -> TestM () +testRemoteMemberGetSubConv isAMember = do + -- alice is local, bob is remote + -- alice creates a local conversation and invites bob + -- bob gets a subconversation via federated enpdoint + + let bobDomain = Domain "faraway.example.com" + [alice, bob] <- createAndConnectUsers [Nothing, Just (domainText bobDomain)] + + runMLSTest $ do + [alice1, bob1] <- traverse createMLSClient [alice, bob] + + (_groupId, qcnv) <- setupMLSGroup alice1 + kpb <- claimKeyPackages alice1 bob + mp <- createAddCommit alice1 [bob] + + let mockedResponse fedReq = + case frRPC fedReq of + "mls-welcome" -> pure (Aeson.encode MLSWelcomeSent) + "on-new-remote-conversation" -> pure (Aeson.encode EmptyResponse) + "on-conversation-updated" -> pure (Aeson.encode ()) + "get-mls-clients" -> + pure + . Aeson.encode + . Set.singleton + $ ClientInfo (ciClient bob1) True + "claim-key-packages" -> pure . Aeson.encode $ kpb + ms -> assertFailure ("unmocked endpoint called: " <> cs ms) + + void . withTempMockFederator' mockedResponse $ + sendAndConsumeCommit mp + + let subconv = SubConvId "conference" + + randUser <- randomId + let gscr = + GetSubConversationsRequest + { gsreqUser = if isAMember then qUnqualified bob else randUser, + gsreqConv = qUnqualified qcnv, + gsreqSubConv = subconv + } + + fedGalleyClient <- view tsFedGalleyClient + res <- runFedClient @"get-sub-conversation" fedGalleyClient bobDomain gscr + + liftTest $ do + if isAMember + then do + sub <- expectSubConvSuccess res + liftIO $ do + pscParentConvId sub @?= qcnv + pscSubConvId sub @?= subconv + else do + expectSubConvError ConvNotFound res + where + expectSubConvSuccess :: GetSubConversationsResponse -> TestM PublicSubConversation + expectSubConvSuccess (GetSubConversationsResponseSuccess fakeSubConv) = pure fakeSubConv + expectSubConvSuccess (GetSubConversationsResponseError err) = liftIO $ assertFailure ("Unexpected GetSubConversationsResponseError: " <> show err) + + expectSubConvError :: GalleyError -> GetSubConversationsResponse -> TestM () + expectSubConvError _errExpected (GetSubConversationsResponseSuccess _) = liftIO $ assertFailure "Unexpected GetSubConversationsResponseSuccess" + expectSubConvError errExpected (GetSubConversationsResponseError err) = liftIO $ err @?= errExpected From a1e121652af2488c01708840bef3db1ee7d314e9 Mon Sep 17 00:00:00 2001 From: Stefan Matting Date: Tue, 27 Dec 2022 12:39:03 +0100 Subject: [PATCH 07/10] Move test stub into correct group --- services/galley/test/integration/API/MLS.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/galley/test/integration/API/MLS.hs b/services/galley/test/integration/API/MLS.hs index 599615585a6..7aaf921179c 100644 --- a/services/galley/test/integration/API/MLS.hs +++ b/services/galley/test/integration/API/MLS.hs @@ -216,7 +216,6 @@ tests s = test s "join subconversation with a client that is not in the main conv" testJoinSubNonMemberClient, test s "add another client to a subconversation" testAddClientSubConv, test s "remove another client from a subconversation" testRemoveClientSubConv, - test s "client of a remote user joins subconversation" testRemoteUserJoinSubConv, test s "send an application message in a subconversation" testSendMessageSubConv ], testGroup @@ -228,7 +227,8 @@ tests s = testGroup "Remote Sender/Local SubConversation" [ test s "get subconversation as a remote member" (testRemoteMemberGetSubConv True), - test s "get subconversation as a remote non-member" (testRemoteMemberGetSubConv False) + test s "get subconversation as a remote non-member" (testRemoteMemberGetSubConv False), + test s "client of a remote user joins subconversation" testRemoteUserJoinSubConv ] ] ] From dbcb2400215cf57e97a31f730367b30d3d7c0f47 Mon Sep 17 00:00:00 2001 From: Stefan Matting Date: Tue, 27 Dec 2022 12:57:02 +0100 Subject: [PATCH 08/10] Add changelog entry --- changelog.d/2-features/pr-2952 | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/2-features/pr-2952 diff --git a/changelog.d/2-features/pr-2952 b/changelog.d/2-features/pr-2952 new file mode 100644 index 00000000000..0bfe30efe71 --- /dev/null +++ b/changelog.d/2-features/pr-2952 @@ -0,0 +1 @@ +Add federated endpoints to get subconversations From c834a2e6daa0f2e40d4ac2d662f12f5a6dbe7b1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Dimja=C5=A1evi=C4=87?= Date: Tue, 27 Dec 2022 14:36:51 +0100 Subject: [PATCH 09/10] Remove unused constraints --- .../src/Galley/API/MLS/SubConversation.hs | 21 ++++--------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/services/galley/src/Galley/API/MLS/SubConversation.hs b/services/galley/src/Galley/API/MLS/SubConversation.hs index c208a66ec61..d9cf14acc04 100644 --- a/services/galley/src/Galley/API/MLS/SubConversation.hs +++ b/services/galley/src/Galley/API/MLS/SubConversation.hs @@ -19,7 +19,6 @@ module Galley.API.MLS.SubConversation where import Data.Id import Data.Qualified -import Galley.API.Error import Galley.API.MLS import Galley.API.MLS.GroupInfo import Galley.API.MLS.Types @@ -33,11 +32,9 @@ import Galley.Effects.FederatorAccess import Galley.Effects.SubConversationStore import qualified Galley.Effects.SubConversationStore as Eff import Imports -import qualified Network.Wai.Utilities.Error as Wai import Polysemy import Polysemy.Error import Polysemy.Input -import qualified Polysemy.TinyLog as P import Wire.API.Conversation import Wire.API.Conversation.Protocol import Wire.API.Error @@ -61,11 +58,8 @@ getSubConversation :: ErrorS 'ConvNotFound, ErrorS 'ConvAccessDenied, ErrorS 'MLSSubConvUnsupportedConvType, - Error InternalError, Error FederationError, - Error Wai.Error, - FederatorAccess, - P.TinyLog + FederatorAccess ] r => Local UserId -> @@ -85,9 +79,7 @@ getLocalSubConversation :: ConversationStore, ErrorS 'ConvNotFound, ErrorS 'ConvAccessDenied, - ErrorS 'MLSSubConvUnsupportedConvType, - Error InternalError, - P.TinyLog + ErrorS 'MLSSubConvUnsupportedConvType ] r => Qualified UserId -> @@ -130,15 +122,10 @@ getLocalSubConversation qusr lconv sconv = do getRemoteSubConversation :: forall r. ( Members - '[ SubConversationStore, - ConversationStore, - ErrorS 'ConvNotFound, + '[ ErrorS 'ConvNotFound, ErrorS 'ConvAccessDenied, ErrorS 'MLSSubConvUnsupportedConvType, - Error InternalError, - Error FederationError, - FederatorAccess, - P.TinyLog + FederatorAccess ] r, Members MLSGetSubConvStaticErrors r, From e40ef68a1591b0c98f5ad277e75e5a664022606f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Dimja=C5=A1evi=C4=87?= Date: Tue, 27 Dec 2022 16:25:08 +0100 Subject: [PATCH 10/10] Hi CI