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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user