From 982c4afd7b654fb9b7fc0b013222e9b96e1fb0cd Mon Sep 17 00:00:00 2001 From: Alexander Bondarenko <486682+dpwiz@users.noreply.github.com> Date: Fri, 26 Apr 2024 22:52:43 +0300 Subject: [PATCH] WIP: don't crash on missing corrId from acks --- src/Simplex/Chat.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Simplex/Chat.hs b/src/Simplex/Chat.hs index 2d02b6ac19..906b085bd0 100644 --- a/src/Simplex/Chat.hs +++ b/src/Simplex/Chat.hs @@ -4694,9 +4694,9 @@ processAgentMessageConn vr user@User {userId} corrId agentConnId agentMessage = | connId == cmdConnId' && (agentMsgTag == commandExpectedResponse cmdFunction || agentMsgTag == APCT SAEConn ERR_) -> do withStore' $ \db -> deleteCommand db user cmdId action cmdData - | otherwise -> err cmdId $ "not matching connection id or unexpected response, corrId = " <> show corrId - Just CommandData {cmdId, cmdConnId = Nothing} -> err cmdId $ "no command connection id, corrId = " <> show corrId - Nothing -> throwChatError . CEAgentCommandError $ "command not found, corrId = " <> show corrId + | otherwise -> logWarn $ "not matching connection id or unexpected response, corrId = " <> tshow corrId + Just CommandData {cmdId, cmdConnId = Nothing} -> logWarn $ "no command connection id, corrId = " <> tshow corrId + Nothing -> logWarn $ "command not found, corrId = " <> tshow corrId where acId = AgentConnId agentConnId ackKey = decodeLatin1 $ strEncode corrId