From b05bc4fe32e3f0d227259c51f63d7fbc9cd3d893 Mon Sep 17 00:00:00 2001 From: Denis Tereshkin Date: Tue, 21 Jan 2025 21:01:03 +0700 Subject: [PATCH] BrokerClient: ignore packets with mismatched request id --- src/ATrade/Broker/Client.hs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ATrade/Broker/Client.hs b/src/ATrade/Broker/Client.hs index 30c6851..689629a 100644 --- a/src/ATrade/Broker/Client.hs +++ b/src/ATrade/Broker/Client.hs @@ -157,9 +157,7 @@ brokerClientThread socketIdentity ep cmd comp killMv notificationCallbacks logge (req, respVar, _) <- takeMVar respVar if getRequestId req == getResponseRequestId resp then putMVar respVar resp - else do - log Warning "Broker.Client" $ TL.toStrict $ [t|Request ID mismatch: %?/%?|] (getRequestId req) (getResponseRequestId resp) - putMVar respVar (ResponseError (getRequestId req) "Request ID mismatch") + else log Warning "Broker.Client" $ TL.toStrict $ [t|Request ID mismatch: %?/%?|] (getRequestId req) (getResponseRequestId resp) handleMessage _ (IncomingNotification notif) = callNotificationCallbacks notif callNotificationCallbacks notif = mapM_ (\cb -> cb notif) notificationCallbacks