fix: preserve SDK 2.0 client value and lifetime contracts

This commit is contained in:
Joseph Doherty
2026-11-10 10:19:42 -05:00
parent 0ecea3c6be
commit 3ca06e1b87
38 changed files with 591 additions and 186 deletions
@@ -40,7 +40,7 @@ internal sealed class FakeSessionFactory : ISessionFactory
uint sessionTimeoutMs, UserIdentity identity, CancellationToken ct)
{
CreateCallCount++;
LastEndpointUrl = endpoint.EndpointUrl;
LastEndpointUrl = endpoint.EndpointUrl ?? string.Empty;
// One-shot: the gate holds only the call that observed it, so a later call (e.g. a user's Connect while a
// failover is held) runs freely.
@@ -60,14 +60,14 @@ internal sealed class FakeSessionFactory : ISessionFactory
else
session = new FakeSessionAdapter
{
EndpointUrl = endpoint.EndpointUrl,
ServerName = endpoint.Server?.ApplicationName?.Text ?? "FakeServer",
EndpointUrl = endpoint.EndpointUrl ?? string.Empty,
ServerName = endpoint.Server?.ApplicationName.Text ?? "FakeServer",
SecurityMode = endpoint.SecurityMode.ToString(),
SecurityPolicyUri = endpoint.SecurityPolicyUri ?? string.Empty
};
// Ensure endpoint URL matches
session.EndpointUrl = endpoint.EndpointUrl;
session.EndpointUrl = endpoint.EndpointUrl ?? string.Empty;
_createdSessions.Add(session);
return session;
}