From 5ce3b85edf79a4f08726dfaf96018b8db8697f0d Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin Date: Fri, 20 Mar 2026 08:33:25 +0000 Subject: [PATCH 1/2] fix small bugs --- src/Simplex/Messaging/Agent/Store/AgentStore.hs | 2 +- src/Simplex/RemoteControl/Types.hs | 11 ----------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/src/Simplex/Messaging/Agent/Store/AgentStore.hs b/src/Simplex/Messaging/Agent/Store/AgentStore.hs index 711f6f05be..37c2c13cbd 100644 --- a/src/Simplex/Messaging/Agent/Store/AgentStore.hs +++ b/src/Simplex/Messaging/Agent/Store/AgentStore.hs @@ -457,7 +457,7 @@ checkConfirmedSndQueueExists_ db SndQueue {server, sndId} = DB.query db ( "SELECT 1 FROM snd_queues WHERE host = ? AND port = ? AND snd_id = ? AND status != ? LIMIT 1" -#if defined(dpPostgres) +#if defined(dbPostgres) <> " FOR UPDATE" #endif ) diff --git a/src/Simplex/RemoteControl/Types.hs b/src/Simplex/RemoteControl/Types.hs index dfeeb9477c..48c623e7cb 100644 --- a/src/Simplex/RemoteControl/Types.hs +++ b/src/Simplex/RemoteControl/Types.hs @@ -13,7 +13,6 @@ module Simplex.RemoteControl.Types RCPVersion, VersionRCP, VersionRangeRCP, - IpProbe (..), RCHostHello (..), RCCtrlHello (..), RCHostPairing (..), @@ -141,16 +140,6 @@ currentRCPVersion = VersionRCP 1 supportedRCPVRange :: VersionRangeRCP supportedRCPVRange = mkVersionRange (VersionRCP 1) currentRCPVersion -data IpProbe = IpProbe - { versionRange :: VersionRangeRCP, - randomNonce :: ByteString - } - deriving (Show) - -instance Encoding IpProbe where - smpEncode IpProbe {versionRange, randomNonce} = smpEncode (versionRange, 'I', randomNonce) - smpP = IpProbe <$> (smpP <* "I") *> smpP - -- * Session data RCHostHello = RCHostHello From f45c2621d6978214feb8dc70b17a8139e7992717 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin Date: Fri, 20 Mar 2026 08:58:36 +0000 Subject: [PATCH 2/2] toChunks --- src/Simplex/Messaging/Util.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Simplex/Messaging/Util.hs b/src/Simplex/Messaging/Util.hs index 3eab9c923b..b032fe884a 100644 --- a/src/Simplex/Messaging/Util.hs +++ b/src/Simplex/Messaging/Util.hs @@ -350,6 +350,7 @@ groupAllOn f = groupOn f . sortOn f -- n must be > 0 toChunks :: Int -> [a] -> [NonEmpty a] toChunks _ [] = [] +toChunks 0 (x : xs) = [x :| xs] toChunks n xs = let (ys, xs') = splitAt n xs in maybe id (:) (L.nonEmpty ys) (toChunks n xs')