review(Client.Shared): fix Disconnect/failover subscription race + CT forwarding

Re-review at 7286d320. -012 (Medium): DisconnectAsync now snapshots+nulls the data/alarm
subscriptions under _subscriptionLock before async teardown (was racing RunFailoverAsync).
-013: SubscribeAlarmsAsync guarded by a semaphore (idempotent under concurrency). -014/-015:
forward CancellationToken through Delete/BrowseNext adapters. + TDD.
This commit is contained in:
Joseph Doherty
2026-06-19 11:58:15 -04:00
parent 887a31e825
commit d68c9db9f9
6 changed files with 240 additions and 28 deletions
@@ -101,10 +101,17 @@ internal sealed class FakeSubscriptionAdapter : ISubscriptionAdapter
return Task.CompletedTask;
}
/// <summary>
/// Gets the cancellation token that was supplied to the most recent <see cref="DeleteAsync"/> call,
/// so tests can assert the CT from the caller is honoured (Client.Shared-014).
/// </summary>
public CancellationToken? LastDeleteCt { get; private set; }
/// <inheritdoc />
public Task DeleteAsync(CancellationToken ct)
{
Deleted = true;
LastDeleteCt = ct;
lock (_itemsLock) _items.Clear();
return Task.CompletedTask;
}