From 46035af9a3f1dac73ec6fd9f304538b39e010955 Mon Sep 17 00:00:00 2001 From: spaced4ndy <8711996+spaced4ndy@users.noreply.github.com> Date: Mon, 18 Aug 2025 09:59:57 +0000 Subject: [PATCH 1/2] agent: add context to SEMsgNotFound error (#1604) --- src/Simplex/Messaging/Agent/Store.hs | 2 +- src/Simplex/Messaging/Agent/Store/AgentStore.hs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Simplex/Messaging/Agent/Store.hs b/src/Simplex/Messaging/Agent/Store.hs index faedce6bb..71e35e7ec 100644 --- a/src/Simplex/Messaging/Agent/Store.hs +++ b/src/Simplex/Messaging/Agent/Store.hs @@ -672,7 +672,7 @@ data StoreError | -- | Invitation not found SEInvitationNotFound String InvitationId | -- | Message not found - SEMsgNotFound + SEMsgNotFound String | -- | Command not found SECmdNotFound | -- | Currently not used. The intention was to pass current expected queue status in methods, diff --git a/src/Simplex/Messaging/Agent/Store/AgentStore.hs b/src/Simplex/Messaging/Agent/Store/AgentStore.hs index 31b4217e3..e10f48c8f 100644 --- a/src/Simplex/Messaging/Agent/Store/AgentStore.hs +++ b/src/Simplex/Messaging/Agent/Store/AgentStore.hs @@ -891,7 +891,7 @@ createSndMsgDelivery db connId SndQueue {dbQueueId} msgId = getSndMsgViaRcpt :: DB.Connection -> ConnId -> InternalSndId -> IO (Either StoreError SndMsg) getSndMsgViaRcpt db connId sndMsgId = - firstRow toSndMsg SEMsgNotFound $ + firstRow toSndMsg (SEMsgNotFound "getSndMsgViaRcpt") $ DB.query db [sql| @@ -1027,7 +1027,7 @@ getExpiredSndMessages db connId SndQueue {dbQueueId} expireTs = do setMsgUserAck :: DB.Connection -> ConnId -> InternalId -> IO (Either StoreError (RcvQueue, SMP.MsgId)) setMsgUserAck db connId agentMsgId = runExceptT $ do (dbRcvId, srvMsgId) <- - ExceptT . firstRow id SEMsgNotFound $ + ExceptT . firstRow id (SEMsgNotFound "setMsgUserAck") $ DB.query db "SELECT rcv_queue_id, broker_id FROM rcv_messages WHERE conn_id = ? AND internal_id = ?" (connId, agentMsgId) rq <- ExceptT $ getRcvQueueById db connId dbRcvId liftIO $ DB.execute db "UPDATE rcv_messages SET user_ack = ? WHERE conn_id = ? AND internal_id = ?" (BI True, connId, agentMsgId) @@ -1035,7 +1035,7 @@ setMsgUserAck db connId agentMsgId = runExceptT $ do getRcvMsg :: DB.Connection -> ConnId -> InternalId -> IO (Either StoreError RcvMsg) getRcvMsg db connId agentMsgId = - firstRow toRcvMsg SEMsgNotFound $ + firstRow toRcvMsg (SEMsgNotFound "getRcvMsg") $ DB.query db [sql| @@ -1085,7 +1085,7 @@ checkRcvMsgHashExists db connId hash = do getRcvMsgBrokerTs :: DB.Connection -> ConnId -> SMP.MsgId -> IO (Either StoreError BrokerTs) getRcvMsgBrokerTs db connId msgId = - firstRow fromOnly SEMsgNotFound $ + firstRow fromOnly (SEMsgNotFound "getRcvMsgBrokerTs") $ DB.query db "SELECT broker_ts FROM rcv_messages WHERE conn_id = ? AND broker_id = ?" (connId, Binary msgId) deleteMsg :: DB.Connection -> ConnId -> InternalId -> IO () From a2d35281b2e20022e75a4dcbecf16a7970d52e8f Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin Date: Mon, 18 Aug 2025 16:22:10 +0100 Subject: [PATCH 2/2] 6.4.4.0 --- simplexmq.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simplexmq.cabal b/simplexmq.cabal index 5f3d96304..145c94516 100644 --- a/simplexmq.cabal +++ b/simplexmq.cabal @@ -1,7 +1,7 @@ cabal-version: 1.12 name: simplexmq -version: 6.4.3.0 +version: 6.4.4.0 synopsis: SimpleXMQ message broker description: This package includes <./docs/Simplex-Messaging-Server.html server>, <./docs/Simplex-Messaging-Client.html client> and