From afc6256effa5559ca9b708840c4b740935bc63ca Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin Date: Tue, 2 Sep 2025 16:45:54 +0100 Subject: [PATCH] fix --- apps/simplex-directory-service/src/Directory/Events.hs | 2 +- src/Simplex/Chat/Library/Commands.hs | 2 +- src/Simplex/Chat/Library/Subscriber.hs | 2 +- src/Simplex/Chat/View.hs | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/simplex-directory-service/src/Directory/Events.hs b/apps/simplex-directory-service/src/Directory/Events.hs index 290742ce03..8ae7f60b3d 100644 --- a/apps/simplex-directory-service/src/Directory/Events.hs +++ b/apps/simplex-directory-service/src/Directory/Events.hs @@ -66,7 +66,7 @@ crDirectoryEvent :: Either ChatError ChatEvent -> Maybe DirectoryEvent crDirectoryEvent = \case Right evt -> crDirectoryEvent_ evt Left e -> case e of - ChatErrorAgent {agentError = BROKER _ NETWORK} -> Nothing + ChatErrorAgent {agentError = BROKER _ (NETWORK _)} -> Nothing ChatErrorAgent {agentError = BROKER _ TIMEOUT} -> Nothing _ -> Just $ DELogChatResponse $ "chat error: " <> tshow e diff --git a/src/Simplex/Chat/Library/Commands.hs b/src/Simplex/Chat/Library/Commands.hs index b6b7dbe87c..d1f5da06f1 100644 --- a/src/Simplex/Chat/Library/Commands.hs +++ b/src/Simplex/Chat/Library/Commands.hs @@ -4209,7 +4209,7 @@ subscribeUserConnections vr onlyNeeded agentBatchSubscribe user = do netStatus = maybe NSConnected $ NSError . errorNetworkStatus errorNetworkStatus :: ChatError -> String errorNetworkStatus = \case - ChatErrorAgent (BROKER _ NETWORK) _ -> "network" + ChatErrorAgent (BROKER _ (NETWORK _)) _ -> "network" ChatErrorAgent (SMP _ SMP.AUTH) _ -> "contact deleted" e -> show e -- TODO possibly below could be replaced with less noisy events for API diff --git a/src/Simplex/Chat/Library/Subscriber.hs b/src/Simplex/Chat/Library/Subscriber.hs index 3109fd5fe9..9ecc09004e 100644 --- a/src/Simplex/Chat/Library/Subscriber.hs +++ b/src/Simplex/Chat/Library/Subscriber.hs @@ -1601,7 +1601,7 @@ processAgentMessageConn vr user@User {userId} corrId agentConnId agentMessage = e -> SndErrOther $ tshow e where brokerError srvErr = \case - NETWORK -> SndErrExpired + NETWORK _ -> SndErrExpired TIMEOUT -> SndErrExpired HOST -> srvErr SrvErrHost SMP.TRANSPORT TEVersion -> srvErr SrvErrVersion diff --git a/src/Simplex/Chat/View.hs b/src/Simplex/Chat/View.hs index 6fef6cc204..63177a44fc 100644 --- a/src/Simplex/Chat/View.hs +++ b/src/Simplex/Chat/View.hs @@ -1509,7 +1509,7 @@ viewServerTestResult (AProtoServerWithAuth p _) = \case where result = [pName <> " server test failed at " <> plain (drop 2 $ show testStep) <> ", error: " <> sShow testError] brokerErr = case testError of - BROKER _ NETWORK -> True + BROKER _ (NETWORK _) -> True _ -> False _ -> [pName <> " server test passed"] where @@ -2536,7 +2536,7 @@ viewChatError isCmd logLevel testView = \case reasonStr = case reason of BRSpam -> "spam" BRContent -> "content violates conditions of use" - BROKER _ NETWORK | not isCmd -> [] + BROKER _ (NETWORK _) | not isCmd -> [] BROKER _ TIMEOUT | not isCmd -> [] AGENT A_DUPLICATE -> [withConnEntity <> "error: AGENT A_DUPLICATE" | logLevel == CLLDebug || isCmd] AGENT (A_PROHIBITED e) -> [withConnEntity <> "error: AGENT A_PROHIBITED, " <> plain e | logLevel <= CLLWarning || isCmd]