fix, debug

This commit is contained in:
Evgeny @ SimpleX Chat committed 2026-10-22 19:36:49 +00:00
1 parent 7e06d55ff5
commit 14dab311e9
2 files changed
+9 -2

No files matched your search

+2 -1
View File
@@ -314,7 +314,8 @@ runXFTPRcvLocalWorker c Worker {doWork} = do
case redirect of
Nothing -> do
notify c rcvFileEntityId $ RFDONE fsSavePath
lift $ forM_ tmpPath (removePath <=< toFSFilePath)
flip catchAllErrors (\e -> logError $ "XFTP rcv worker error: " <> tshow e) $
lift $ forM_ tmpPath (removePath <=< toFSFilePath)
liftIO $ waitUntilForeground c
withStore' c (`updateRcvFileComplete` rcvFileId)
Just RcvFileRedirect {redirectFileInfo, redirectDbId} -> do
+7 -1
View File
@@ -652,7 +652,13 @@ getProtocolClient g nm transportSession@(_, srv, _) cfg@ProtocolClientConfig {qS
writeTVar (connected c) True
putTMVar cVar $ Right c'
raceAny_ ([send c' th, process c', receive c' th] <> [monitor c' | smpPingInterval > 0])
`E.finally` disconnected c'
`E.finally` (failPendingRequests c >> disconnected c')
failPendingRequests :: PClient v err msg -> IO ()
failPendingRequests PClient {sentCommands} = atomically $ do
rs <- swapTVar sentCommands mempty
forM_ rs $ \Request {pending, responseVar} ->
whenM (swapTVar pending False) $ void $ tryPutTMVar responseVar $ Left $ PCENetworkError NEFailedError
send :: Transport c => ProtocolClient v err msg -> THandle v c 'TClient -> IO ()
send ProtocolClient {client_ = PClient {sndQ}} h = forever $ atomically (readTBQueue sndQ) >>= sendPending