put traces on suspicious code

This commit is contained in:
IC Rainbow
2024-03-06 21:19:28 +02:00
parent 25214076d8
commit 901b4a3fa7
4 changed files with 6 additions and 5 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ constraints: zip +disable-bzip2 +disable-zstd
source-repository-package
type: git
location: https://github.com/simplex-chat/simplexmq.git
tag: 246a0d10c22ebe02af2eb34773b77cce10247459
tag: 21a9051e8bf3a0bb98cdb78b6b7653101051b5ef
source-repository-package
type: git
+1
View File
@@ -86,6 +86,7 @@ executables:
- websockets == 0.12.*
ghc-options:
- -threaded
- -rtsopts
simplex-bot:
source-dirs: apps/simplex-bot
+1 -1
View File
@@ -423,7 +423,7 @@ executable simplex-chat
Paths_simplex_chat
hs-source-dirs:
apps/simplex-chat
ghc-options: -Wall -Wcompat -Werror=incomplete-patterns -Wredundant-constraints -Wincomplete-record-updates -Wincomplete-uni-patterns -Wunused-type-patterns -threaded
ghc-options: -Wall -Wcompat -Werror=incomplete-patterns -Wredundant-constraints -Wincomplete-record-updates -Wincomplete-uni-patterns -Wunused-type-patterns -threaded -rtsopts
build-depends:
aeson ==2.2.*
, ansi-terminal >=0.10 && <0.12
+3 -3
View File
@@ -359,7 +359,7 @@ startChatController mainApp = do
setExpireCIFlag user True
subscribeUsers :: forall m. ChatMonad' m => Bool -> [User] -> m ()
subscribeUsers onlyNeeded users = do
subscribeUsers onlyNeeded users = traceSection "subscribeUsers" $ do
let (us, us') = partition activeUser users
vr <- chatVersionRange
subscribe vr us
@@ -4128,7 +4128,7 @@ processAgentMessageConn vr user@User {userId} corrId agentConnId agentMessage =
XOk -> allowAgentConnectionAsync user conn' confId XOk -- [async agent commands] no continuation needed, but command should be asynchronous for stability
_ -> pure ()
CON -> startReceivingFile user fileId
MSG meta _ msgBody -> do
MSG meta _ msgBody -> traceSection "MSG-FileChunk" $ do
parseFileChunk msgBody >>= receiveFileChunk ft (Just conn) meta
OK ->
-- [async agent commands] continuation on receiving OK
@@ -4280,7 +4280,7 @@ processAgentMessageConn vr user@User {userId} corrId agentConnId agentMessage =
-- 1) retry processing several times
-- 2) stabilize database
-- 3) show screen of death to the user asking to restart
tryChatError action >>= \case
traceSlow "withAckMessage" 30 (tryChatError action) >>= \case
Right withRcpt -> ackMsg cId cmdId msgMeta $ if withRcpt then Just "" else Nothing
Left e -> ackMsg cId cmdId msgMeta Nothing >> throwError e