EventStore / EventStore-Client-Dotnet

Dotnet Client SDK for the Event Store gRPC Client API written in C#
Other
138 stars 38 forks source link

DEV-266 - Return null for discovery mode or multiple hosts in connection string #280

Closed w1am closed 4 months ago

w1am commented 5 months ago

Changed: Return null for discovery mode or multiple hosts in connection string Changed: Updated Address field to support null returns Fixed: #260

This PR refactors the Address property resolution logic in the EventStoreClientConnectivitySettings class. Previously, when a cluster was specified in the connection string, the Address property defaulted to localhost:2113, which was inconsistent behavior. With this change, the logic now returns null when a cluster is specified. New tests have also been added to cover various connection string scenarios.

Changes

Connection string Behaviour before Behaviour after
esdb://localhost:1234 localhost:1234 Unchanged
esdb://localhost:1234,localhost:4567 localhost:2113 null
esdb+discover://localhost:1234 localhost:2113 null
esdb+discover://localhost:1234 localhost:2113 null
esdb+discover://localhost:1234,localhost:4567 localhost:2113 null
linear[bot] commented 5 months ago

DEV-266 Improve connectivity settings address resolution logic