Skip to content

Commit

Permalink
Fix for HandleUpdatesBeforeConfirmation if set on subscription itself
Browse files Browse the repository at this point in the history
  • Loading branch information
JKorf committed Mar 20, 2024
1 parent 87f5e12 commit 926802d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CryptoExchange.Net/Clients/SocketApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ protected virtual async Task<CallResult<UpdateSubscription>> SubscribeAsync(stri
return socketResult.As<UpdateSubscription>(null);

socketConnection = socketResult.Data;
subscription.HandleUpdatesBeforeConfirmation = HandleMessageBeforeConfirmation;
subscription.HandleUpdatesBeforeConfirmation = subscription.HandleUpdatesBeforeConfirmation || HandleMessageBeforeConfirmation;

// Add a subscription on the socket connection
var success = socketConnection.AddSubscription(subscription);
Expand Down
2 changes: 1 addition & 1 deletion CryptoExchange.Net/Sockets/SocketConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ protected virtual void HandleStreamMessage(WebSocketMessageType type, ReadOnlyMe
{
List<string> listenerIds;
lock (_listenersLock)
listenerIds = _listeners.SelectMany(l => l.ListenerIdentifiers).ToList();
listenerIds = _listeners.Where(l => l.CanHandleData).SelectMany(l => l.ListenerIdentifiers).ToList();
_logger.LogWarning("[Sckt {SocketId}] received message not matched to any listener. ListenId: {ListenId}, current listeners: {ListenIds}", SocketId, listenId, listenerIds);
UnhandledMessage?.Invoke(_accessor);
}
Expand Down

0 comments on commit 926802d

Please sign in to comment.