fix(dcl): deliver initial-read seed value after subscription registration #2
Reference in New Issue
Block a user
Delete Branch "fix/dcl-seed-after-registration"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
ScadaBridge Site instances bound to MxGateway tags whose value never changes (e.g. idle MES
MESReceiver_*fields) stayed at quality Uncertain forever — observed live on wonder-app-vd03 for reactors Z28061/Z28062 (48 bindings, all Uncertain) despite the gateway returning Good values.Root cause
DataConnectionActor.HandleSubscribeseeded each tag's initial value byTell-ingTagValueReceivedfrom its background subscribe task, which completes beforeHandleSubscribeCompletedregisters the instance's tags in_subscriptionsByInstance. The seed therefore reachedHandleTagValueReceivedwhile the fan-out map was still empty and was silently dropped. A tag that soon gets an OnDataChange recovers; a static tag (no further change) never does.Fix
Seed values now ride back on the
SubscribeCompletedmessage and are delivered after registration, re-enteringHandleTagValueReceivedviaSelf(reusing the generation guard, fan-out and quality accounting). Only resolved tags are seeded, so an unresolved tag's Bad-quality signal is not masked.Tests
DCL026_StaticTagSeedValue_IsDeliveredAfterRegistration.DataConnectionLayer.Testsgreen (155).Verification
Deployed to wonder-app-vd03; Z28061 & Z28062 now read 24/24 Good with live values (e.g.
LeftMESReceiver.MoveInBatchID=107241,MoveInCompleteFlag=True).