EventStore / EventStoreDB-Client-Dotnet-Legacy

1 stars 8 forks source link

PersistentSubscriptionsManager missaligned with the api, should it be unit tested ? #73

Open jrouaix opened 4 years ago

jrouaix commented 4 years ago

Describe the bug Hello, trying to use PersistentSubscriptionsManager and the object model PersistentSubscriptionDetails is actually not aligned with the actual api payload so the connections list is null, and there is no way to get the connections count.

To Reproduce Steps to reproduce the behavior:

var cred = new UserCredentials("user", "pass");
var endpoint = new IPEndPoint(/* master_ip */, /* master_http_port */);
var subsMan = new PersistentSubscriptionsManager(_gesLogger, endpoint, TimeSpan.FromSeconds(1));
var list = await subsMan.List(cred).CAF();

var count = list.First().Connections.Count; // NullRefException !

Expected behavior The client nuget should have same model than the actual API payload.

Config/Logs/Screenshots

image

EventStore details

hayley-jean commented 4 years ago

Hi @jrouaix, according to the comments in the client code, Connections is only populated when the details are fetched through the Describe method and will be null when fetched through the List method.

I've changed the label from bug to enhancement, as we could improve the api around the persistent subscription manager in the tcp client.

jrouaix commented 4 years ago

Ho, you're right @hayley-jean. Still perhaps you can just embody the connectionCount data in a property ?