diff --git a/Libraries/Opc.Ua.Client/Session/Session.cs b/Libraries/Opc.Ua.Client/Session/Session.cs index 06c3c5ceb..964abe78d 100644 --- a/Libraries/Opc.Ua.Client/Session/Session.cs +++ b/Libraries/Opc.Ua.Client/Session/Session.cs @@ -2510,18 +2510,18 @@ public async Task ReconnectAsync( /// /// Recreate the subscriptions in a recreated session. /// - /// Uses Transfer service + /// Uses Transfer service /// if set to true. /// The template for the subscriptions. /// Cancellation token to cancel operation with private async Task RecreateSubscriptionsAsync( - bool transferSbscriptionTemplates, + bool transferSubscriptionTemplates, IEnumerable subscriptionsTemplate, CancellationToken ct) { using Activity? activity = m_telemetry.StartActivity(); bool transferred = false; - if (transferSbscriptionTemplates) + if (transferSubscriptionTemplates) { try { @@ -3533,7 +3533,8 @@ private void OnPublishComplete( // raise an error event. var error = new ServiceResult(e); - if (error.Code != StatusCodes.BadNoSubscription) + // raise publish error even for BadNoSubscription if there are active subscriptions. + if (error.Code != StatusCodes.BadNoSubscription || m_subscriptions.Any(s => s.Created)) { PublishErrorEventHandler? callback = m_PublishError;