mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-04-29 14:45:51 +00:00
fix: connection-level locks (#543)
* fix: connection-level locks * add context to store error * convert SERatchetNotFound to CONN NOT_FOUND
This commit is contained in:
committed by
GitHub
parent
f4baa5d672
commit
0fa40fbfb0
@@ -726,7 +726,7 @@ runCommandProcessing c@AgentClient {subQ} server = do
|
||||
DEL -> tryCommand $ deleteConnection' c connId >> notify OK
|
||||
_ -> notify $ ERR $ INTERNAL $ "unsupported async command " <> show (aCommandTag cmd)
|
||||
AInternalCommand cmd -> case server of
|
||||
Just _srv -> case cmd of
|
||||
Just _srv -> withConnLock c connId $ case cmd of
|
||||
ICAckDel _rId srvMsgId msgId -> tryCommand $ ack _rId srvMsgId >> withStore' c (\db -> deleteMsg db connId msgId)
|
||||
ICAck _rId srvMsgId -> tryCommand $ ack _rId srvMsgId
|
||||
ICAllowSecure _rId senderKey -> tryCommand $ do
|
||||
|
||||
@@ -850,6 +850,7 @@ withStore c action = do
|
||||
storeError :: StoreError -> AgentErrorType
|
||||
storeError = \case
|
||||
SEConnNotFound -> CONN NOT_FOUND
|
||||
SERatchetNotFound -> CONN NOT_FOUND
|
||||
SEConnDuplicate -> CONN DUPLICATE
|
||||
SEBadConnType CRcv -> CONN SIMPLEX
|
||||
SEBadConnType CSnd -> CONN SIMPLEX
|
||||
|
||||
Reference in New Issue
Block a user