From 40977ebdbe6a192d7c1554470d622a3802d50744 Mon Sep 17 00:00:00 2001 From: Jkorf Date: Thu, 7 Aug 2025 14:15:18 +0200 Subject: [PATCH] Fixed timing issue in query response processing --- CryptoExchange.Net/Sockets/Query.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/CryptoExchange.Net/Sockets/Query.cs b/CryptoExchange.Net/Sockets/Query.cs index a79afcb..a103200 100644 --- a/CryptoExchange.Net/Sockets/Query.cs +++ b/CryptoExchange.Net/Sockets/Query.cs @@ -187,11 +187,8 @@ namespace CryptoExchange.Net.Sockets return CallResult.SuccessResult; CurrentResponses++; - if (CurrentResponses == RequiredResponses) - { - Completed = true; - Response = message.Data; - } + if (CurrentResponses == RequiredResponses) + Response = message.Data; if (Result?.Success != false) // If an error result is already set don't override that @@ -199,6 +196,7 @@ namespace CryptoExchange.Net.Sockets if (CurrentResponses == RequiredResponses) { + Completed = true; _event.Set(); if (ContinueAwaiter != null) await ContinueAwaiter.WaitAsync().ConfigureAwait(false);