diff --git a/cabal.project b/cabal.project index cc143cc0fb..2e2f51fae9 100644 --- a/cabal.project +++ b/cabal.project @@ -7,7 +7,7 @@ constraints: zip +disable-bzip2 +disable-zstd source-repository-package type: git location: https://github.com/simplex-chat/simplexmq.git - tag: 6a665a083387fe7145d161957f0fcab223a48838 + tag: 0f23b4ab5c4c8bf5b937344c865fb195040f3c33 source-repository-package type: git diff --git a/scripts/nix/sha256map.nix b/scripts/nix/sha256map.nix index 9ffd79f722..7920850741 100644 --- a/scripts/nix/sha256map.nix +++ b/scripts/nix/sha256map.nix @@ -1,5 +1,5 @@ { - "https://github.com/simplex-chat/simplexmq.git"."6a665a083387fe7145d161957f0fcab223a48838" = "06nmqbnvalwx8zc8dndzcp31asm65clx519aplzpkipjcbyz93y4"; + "https://github.com/simplex-chat/simplexmq.git"."0f23b4ab5c4c8bf5b937344c865fb195040f3c33" = "15dmz8qkz2jpc0ak71waiqn7x4lmlhiifymk31qxfdpywh96l55f"; "https://github.com/simplex-chat/hs-socks.git"."a30cc7a79a08d8108316094f8f2f82a0c5e1ac51" = "0yasvnr7g91k76mjkamvzab2kvlb1g5pspjyjn2fr6v83swjhj38"; "https://github.com/kazu-yamamoto/http2.git"."78e18f52295a7f89e828539a03fbcb24931461a3" = "05q165anvv0qrcxqbvq1dlvw0l8gmsa9kl6sazk1mfhz2g0yimdk"; "https://github.com/simplex-chat/direct-sqlcipher.git"."34309410eb2069b029b8fc1872deb1e0db123294" = "0kwkmhyfsn2lixdlgl15smgr1h5gjk7fky6abzh8rng2h5ymnffd"; diff --git a/src/Simplex/Chat.hs b/src/Simplex/Chat.hs index 20b7c999cc..774eb6895b 100644 --- a/src/Simplex/Chat.hs +++ b/src/Simplex/Chat.hs @@ -2328,6 +2328,12 @@ processAgentMsgSndFile _corrId aFileId msg = void $ sendFileDescription sft rfd sharedMsgId $ \msg' -> sendDirectMessage conn msg' $ GroupId groupId _ -> pure () _ -> pure () -- TODO error? + SFERR e -> do + throwChatError $ CEXFTPSndFile fileId (AgentSndFileId aFileId) e + -- update chat item status + -- send status to view + -- agentXFTPDeleteSndFile + pure () where sendFileDescription :: SndFileTransfer -> ValidFileDescription 'FRecipient -> SharedMsgId -> (ChatMsgEvent 'Json -> m (SndMessage, Int64)) -> m Int64 sendFileDescription sft rfd msgId sendMsg = do @@ -2378,11 +2384,11 @@ processAgentMsgRcvFile _corrId aFileId msg = getChatItemByFileId db user fileId agentXFTPDeleteRcvFile user aFileId fileId toView $ CRRcvFileComplete user ci - RFERR _e -> do + RFERR e -> do + throwChatError $ CEXFTPRcvFile fileId (AgentRcvFileId aFileId) e -- update chat item status -- send status to view agentXFTPDeleteRcvFile user aFileId fileId - pure () processAgentMessageConn :: forall m. ChatMonad m => User -> ACorrId -> ConnId -> ACommand 'Agent 'AEConn -> m () processAgentMessageConn user _ agentConnId END = diff --git a/src/Simplex/Chat/Controller.hs b/src/Simplex/Chat/Controller.hs index 3de890d79c..c8fa158280 100644 --- a/src/Simplex/Chat/Controller.hs +++ b/src/Simplex/Chat/Controller.hs @@ -780,6 +780,8 @@ data ChatErrorType | CEFileImageType {filePath :: FilePath} | CEFileImageSize {filePath :: FilePath} | CEFileNotReceived {fileId :: FileTransferId} + | CEXFTPRcvFile {fileId :: FileTransferId, agentRcvFileId :: AgentRcvFileId, agentError :: AgentErrorType} + | CEXFTPSndFile {fileId :: FileTransferId, agentSndFileId :: AgentSndFileId, agentError :: AgentErrorType} | CEInlineFileProhibited {fileId :: FileTransferId} | CEInvalidQuote | CEInvalidChatItemUpdate diff --git a/src/Simplex/Chat/Mobile.hs b/src/Simplex/Chat/Mobile.hs index a4aea94bc5..3213671360 100644 --- a/src/Simplex/Chat/Mobile.hs +++ b/src/Simplex/Chat/Mobile.hs @@ -134,7 +134,10 @@ mobileChatOpts dbFilePrefix dbKey = defaultMobileConfig :: ChatConfig defaultMobileConfig = - defaultChatConfig {confirmMigrations = MCYesUp} + defaultChatConfig + { confirmMigrations = MCYesUp, + logLevel = CLLError + } type CJSONString = CString diff --git a/src/Simplex/Chat/View.hs b/src/Simplex/Chat/View.hs index 717c26948f..3104f1dd1f 100644 --- a/src/Simplex/Chat/View.hs +++ b/src/Simplex/Chat/View.hs @@ -1284,6 +1284,8 @@ viewChatError logLevel = \case CEFileImageType _ -> ["image type must be jpg, send as a file using " <> highlight' "/f"] CEFileImageSize _ -> ["max image size: " <> sShow maxImageSize <> " bytes, resize it or send as a file using " <> highlight' "/f"] CEFileNotReceived fileId -> ["file " <> sShow fileId <> " not received"] + CEXFTPRcvFile fileId aFileId e -> ["error receiving XFTP file " <> sShow fileId <> ", agent file id " <> sShow aFileId <> ": " <> sShow e | logLevel == CLLError] + CEXFTPSndFile fileId aFileId e -> ["error sending XFTP file " <> sShow fileId <> ", agent file id " <> sShow aFileId <> ": " <> sShow e | logLevel == CLLError] CEInlineFileProhibited _ -> ["A small file sent without acceptance - you can enable receiving such files with -f option."] CEInvalidQuote -> ["cannot reply to this message"] CEInvalidChatItemUpdate -> ["cannot update this item"] diff --git a/stack.yaml b/stack.yaml index ff289f8040..31f74b4400 100644 --- a/stack.yaml +++ b/stack.yaml @@ -49,7 +49,7 @@ extra-deps: # - simplexmq-1.0.0@sha256:34b2004728ae396e3ae449cd090ba7410781e2b3cefc59259915f4ca5daa9ea8,8561 # - ../simplexmq - github: simplex-chat/simplexmq - commit: 6a665a083387fe7145d161957f0fcab223a48838 + commit: 0f23b4ab5c4c8bf5b937344c865fb195040f3c33 - github: kazu-yamamoto/http2 commit: 78e18f52295a7f89e828539a03fbcb24931461a3 # - ../direct-sqlcipher diff --git a/tests/ChatClient.hs b/tests/ChatClient.hs index dcb8f3fc40..f888bedcce 100644 --- a/tests/ChatClient.hs +++ b/tests/ChatClient.hs @@ -100,7 +100,11 @@ aCfg :: AgentConfig aCfg = (agentConfig defaultChatConfig) {tbqSize = 16} testAgentCfg :: AgentConfig -testAgentCfg = aCfg {reconnectInterval = (reconnectInterval aCfg) {initialInterval = 50000}} +testAgentCfg = + aCfg + { reconnectInterval = (reconnectInterval aCfg) {initialInterval = 50000}, + xftpNotifyErrsOnRetry = False + } testCfg :: ChatConfig testCfg =