fix(lmxproxy): await COM subscription creation to fix Subscribe flakiness
SubscriptionManager.Subscribe was fire-and-forgetting the MxAccess COM subscription creation. The initial OnDataChange callback could fire before the subscription was established, losing the first (and possibly only) value update. Changed to async SubscribeAsync that awaits CreateMxAccessSubscriptionsAsync before returning the channel reader. Subscribe_ReceivesUpdates now passes 5/5 consecutive runs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -360,7 +360,7 @@ namespace ZB.MOM.WW.LmxProxy.Host.Grpc.Services
|
||||
throw new RpcException(new GrpcStatus(StatusCode.Unauthenticated, "Invalid session"));
|
||||
}
|
||||
|
||||
var reader = _subscriptionManager.Subscribe(
|
||||
var reader = await _subscriptionManager.SubscribeAsync(
|
||||
request.SessionId, request.Tags, context.CancellationToken);
|
||||
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user