From 7c3b222e3a7f02c0f13274f189dbeb7a8fd9f376 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Dimja=C5=A1evi=C4=87?= Date: Thu, 2 Feb 2023 14:27:07 +0100 Subject: [PATCH] Remove debugging statements --- services/brig/src/Brig/Data/MLS/KeyPackage.hs | 5 +---- services/galley/src/Galley/API/MLS/Message.hs | 7 ------- services/galley/src/Galley/API/MLS/Welcome.hs | 8 +------- services/galley/test/integration/API/MLS.hs | 5 +---- 4 files changed, 3 insertions(+), 22 deletions(-) diff --git a/services/brig/src/Brig/Data/MLS/KeyPackage.hs b/services/brig/src/Brig/Data/MLS/KeyPackage.hs index 2c1b8c289e4..a849e9ed3e8 100644 --- a/services/brig/src/Brig/Data/MLS/KeyPackage.hs +++ b/services/brig/src/Brig/Data/MLS/KeyPackage.hs @@ -45,7 +45,6 @@ import Data.Id import Data.Qualified import Data.Time.Clock import Data.Time.Clock.POSIX -import Debug.Trace import Imports import Wire.API.MLS.Credential import Wire.API.MLS.KeyPackage @@ -187,8 +186,7 @@ keyPackageRefSetConvId ref convId = do q = "UPDATE mls_key_package_refs SET conv_domain = ?, conv = ? WHERE ref = ? IF EXISTS" addKeyPackageRef :: MonadClient m => KeyPackageRef -> NewKeyPackageRef -> m () -addKeyPackageRef ref nkpr = do - traceM ("addKeyPackageRef " <> show ref) +addKeyPackageRef ref nkpr = retry x5 $ write q @@ -211,7 +209,6 @@ updateKeyPackageRef prevRef newRef = backup <- backupKeyPackageMeta prevRef lift $ do restoreKeyPackageMeta newRef backup - traceM ("updateKeyPackageRef: calling deleteKeyPackage with ref " <> show prevRef) deleteKeyPackage prevRef -------------------------------------------------------------------------------- diff --git a/services/galley/src/Galley/API/MLS/Message.hs b/services/galley/src/Galley/API/MLS/Message.hs index e31b052f869..9dd857280a7 100644 --- a/services/galley/src/Galley/API/MLS/Message.hs +++ b/services/galley/src/Galley/API/MLS/Message.hs @@ -27,7 +27,6 @@ module Galley.API.MLS.Message where import Control.Arrow ((>>>)) -import Debug.Trace import Control.Comonad import Control.Error.Util (hush) import Control.Lens (forOf_, preview) @@ -476,9 +475,7 @@ getSenderClient qusr SMLSPlainText msg = case msgSender msg of PreconfiguredSender _ -> pure Nothing NewMemberSender -> pure Nothing MemberSender ref -> do - traceM "getSenderClient before" cid <- derefKeyPackage ref - traceM "getSenderClient after" when (fmap fst (cidQualifiedClient cid) /= qusr) $ throwS @'MLSClientSenderUserMismatch pure (Just (ciClient cid)) @@ -822,9 +819,7 @@ processExternalCommit qusr mSenderClient lConvOrSub epoch action updatePath = wi unless (user == u) $ throwS @'MLSClientSenderUserMismatch ref <- ensureSingleton clients - traceM "derefUser before" ci <- derefKeyPackage ref - traceM "derefUser after" unless (cidQualifiedUser ci == user) $ throwS @'MLSClientSenderUserMismatch pure (ci, ref) @@ -1078,9 +1073,7 @@ applyProposal convOrSubConvId groupId (AddProposal kp) = do addMLSClients groupId qusr (Set.singleton (ciClient cid, ref)) pure cid applyProposal _convOrSubConvId _groupId (RemoveProposal ref) = do - traceM "applyProposal before" qclient <- cidQualifiedClient <$> derefKeyPackage ref - traceM "applyProposal after" pure (paRemoveClient ((,ref) <$$> qclient)) applyProposal _convOrSubConvId _groupId (ExternalInitProposal _) = -- only record the fact there was an external init proposal, but do not diff --git a/services/galley/src/Galley/API/MLS/Welcome.hs b/services/galley/src/Galley/API/MLS/Welcome.hs index 50cd01c78de..84c67b31f96 100644 --- a/services/galley/src/Galley/API/MLS/Welcome.hs +++ b/services/galley/src/Galley/API/MLS/Welcome.hs @@ -28,7 +28,6 @@ import Data.Id import Data.Json.Util import Data.Qualified import Data.Time -import Debug.Trace import Galley.API.MLS.Enabled import Galley.API.MLS.KeyPackage import Galley.API.Push @@ -111,12 +110,7 @@ welcomeRecipients :: welcomeRecipients = traverse ( fmap cidQualifiedClient - . ( \x -> do - traceM "welcomeRecipients before" - res <- derefKeyPackage x - traceM "welcomeRecipients after" - pure res - ) + . derefKeyPackage . gsNewMember ) . welSecrets diff --git a/services/galley/test/integration/API/MLS.hs b/services/galley/test/integration/API/MLS.hs index 85349b7632f..72990d1e6c4 100644 --- a/services/galley/test/integration/API/MLS.hs +++ b/services/galley/test/integration/API/MLS.hs @@ -45,7 +45,6 @@ import Data.Singletons import Data.String.Conversions import qualified Data.Text as T import Data.Time -import Debug.Trace import Federator.MockServer hiding (withTempMockFederator) import Imports import qualified Network.Wai.Utilities.Error as Wai @@ -1594,7 +1593,7 @@ testBackendRemoveProposalRecreateClient = do void $ createPendingProposalCommit alice1 >>= sendAndConsumeCommitBundle (_, ref) <- assertOne =<< getClientsFromGroupState alice1 alice - traceM ("test: the ref " <> show ref) + liftTest $ deleteClient (qUnqualified alice) (ciClient alice1) (Just defPassword) !!! const 200 === statusCode @@ -1612,8 +1611,6 @@ testBackendRemoveProposalRecreateClient = do wsAssertBackendRemoveProposal alice qcnv ref consumeMessage1 alice2 proposal - - -- this fails with 404 mls-key-package-ref-not-found void $ createPendingProposalCommit alice2 >>= sendAndConsumeCommitBundle void $ createApplicationMessage alice2 "hello" >>= sendAndConsumeMessage