diff --git a/docs/drivers/Galaxy.md b/docs/drivers/Galaxy.md index efc490b00..a5dbe9c85 100644 --- a/docs/drivers/Galaxy.md +++ b/docs/drivers/Galaxy.md @@ -226,7 +226,7 @@ Every (re)open of `StreamAlarms` replays the gateway's active-alarm snapshot. `G ⚠️ This cannot currently fire: the sentinel is only emitted on a stream opened with `after_worker_sequence > 0`, and the driver opens with `0`, which the gateway treats as "fresh stream, not a resume". Enabling resume is a bigger change than it looks — the sequence is only meaningful **within one gateway session**, and the reconnect path recreates the session, so a remembered sequence replayed against a fresh session would set the server's live watermark *above* every event it is about to send, silencing the stream rather than recovering it. - **Undecodable values** (`galaxy.events.undecodable`): a value kind this driver has no CLR representation for is published as **`BadTypeMismatch` with a null value**, and the first occurrence of each distinct kind is logged. It is *not* published as a null carrying the event's own quality: an MXAccess event can be Good-quality while the payload is one we cannot map, and a good null is indistinguishable from a genuine null reading — a client would consume a value it never received as a real one, with the failure visible only in a log. Non-zero here means the gateway is sending a wire type `MxValueDecoder` has no mapping for and those readings are being lost; the fix is a decoder mapping, not a quality change. - **Initial values can overtake the subscribe reply (#859)** (`galaxy.events.early_parked` / `early_replayed` / `early_overflow`): mxaccessgw gives no reply-before-event ordering — the worker frames the SubscribeBulk reply on a thread-pool continuation while the STA is already pumping the OnDataChange that Advise queued, and the reply (unary Invoke) and the event (StreamEvents) are separate HTTP/2 streams anyway. An event for an unregistered handle is therefore only "stale after unsubscribe" when no subscribe is in flight. Every SubscribeBulk call site (`SubscribeAsync`, the subscribe-once `ReadAsync` — which waits only for the initial value and would otherwise read `BadTimeout` — the reconnect/replay-gap `ResubscribeAllAsync` (one window per subscription, not across the whole replay), `PerPlatformProbeWatcher`) opens `SubscriptionRegistry.BeginPendingSubscribe()` before the RPC and closes it right after registering, never later; inside the window unknown-handle events are parked, promoted by the `Register`/`Rebind` that binds the handle — map writes and promotion are one critical section, so no later event can resolve in between — and replayed on the pump's dispatch thread before any later event for that handle. Held events (parked + promoted-but-unreplayed) are bounded at 100 000 together. Unclaimed parked events are trimmed by **window sequence**, not only when every window has closed (concurrent reads keep some window open almost permanently): each window gets a monotonically increasing sequence when it opens, each parked event is stamped with the newest sequence, and once every window that opened at or before that stamp has closed the event is discarded — outside any window the stale drop is unchanged. **Sessions (#861):** item handles are per gateway session and the next session reuses the numbers. On reconnect `ReopenAsync` calls `SubscriptionRegistry.StartNewSession()` both before and after the gateway session swap (`ReplayAsync` does it only when no reopen ran), and the replay re-subscribes only subscriptions still holding the previous session's handles (one registered after the swap is already live). The pump is always restarted, even with nothing to replay. `StartNewSession()` discards everything held, **invalidates the reverse map** (subscriptions are kept; new-session events park until the replay's per-subscription `Rebind` promotes them, instead of resolving to the tag that owned the number before), and bumps a session number. Registration and rebind are refused for a stale session, so a `SubscribeAsync` whose reply straddled the reconnect is **re-issued on the new session** (up to 3 attempts), a subscribe-once read returns `BadCommunicationError`, and dead old-session handle numbers are never sent to `UnsubscribeBulk` (a read rebound by the replay releases the handles the registry holds, not its original ones); an old session's pump can no longer resolve through the map. Reads listen on the driver, not on a pump instance, so a read survives the reconnect's pump restart. `PerPlatformProbeWatcher` records the session with each probe handle: only current-session handles are published (fenced `TryUpsert`), unsubscribed or purged, and a seed reply that straddled a reconnect is re-issued. Purges are fenced by the session captured before the unsubscribe RPC. **Interim (I-3):** a completed `UnsubscribeBulk` purges anything parked for its handles, so a trailing event of a removed item is not promoted onto a reused handle number within one session. It cannot catch an event still in flight after the unsubscribe, and it also drops a genuine early value for a number reused that fast (a timeout rather than another tag's value). The complete fix needs a worker sequence on the SubscribeBulk reply so the driver can tell pre-subscribe events from post-subscribe ones — an optional cross-repo change in mxaccessgw. -- **Native-alarm reference forms (#895)**: the gateway alarm feed names an alarm `Galaxy!..`, with `SourceObjectReference = .`. An alarm tag may carry either form as its `attributeRef`: the plain `.` the AdminUI Galaxy picker authors, or the provider-qualified form. The driver matches a transition on the full reference, then the source reference, then the full reference with its `Provider!Area.` prefix stripped. It remembers the full reference so that an ack dials what `AcknowledgeAlarm` accepts, since the gateway refuses a non-provider reference. Before #895, a picker-authored alarm never went active (found in the G6 live gate, `docs/drivers/evidence/galaxy-g6-e2e-2026-11-12.md`). +- **Native-alarm reference forms (#895)**: the gateway alarm feed names an alarm `Galaxy!..`, with `SourceObjectReference = .`. An alarm tag may carry either form as its `attributeRef`: the plain `.` the AdminUI Galaxy picker authors, or the provider-qualified form. The driver matches a transition on the full reference, then the source reference, then the full reference with its `Provider!Area.` prefix stripped. If none of those match an authored `attributeRef`, the area-free names are matched against the provider-qualified ones with their area removed, so a hand-authored `Galaxy!..` still resolves after Galaxy moves the object to another area. A reference with an empty area (`Galaxy!.`) also matches, and so does the gateway's subtag provider, which sends only `` as the source reference. The driver remembers the latest full reference per tag, including transitions that arrive before an alarm subscription is registered, so that an ack dials what `AcknowledgeAlarm` accepts, since the gateway refuses a non-provider reference. A picker-form tag that has had no transition since the driver started still dials the bare `.`. When the same alarm is authored in both forms, the provider-form tag gets the transitions while the area matches, and a warning is logged. Before #895, a picker-authored alarm never went active (found in the G6 live gate, `docs/drivers/evidence/galaxy-g6-e2e-2026-11-12.md`). - **Duplicate `attributeRef` (#605 / 06-S-13)**: two authored RawPaths dialling the same Galaxy attribute are both dialled, but the reverse map is first-wins, so value fan-out and alarm `ConditionId` surface under the first RawPath only. The loser is logged at Warning and recorded in the skipped-tag ledger with the winner path in the reason. - **Subscribe-once reads are bounded (#605 / 06-S-3)**: `ReadAsync` on the production path (SubscribeBulk, first event, Unsubscribe) carries an internal 30 s deadline in addition to the caller token; slots that never publish come back `BadTimeout`, so `CancellationToken.None` can no longer hang on a silent tag. - **Supervisory advise is retried after a thrown failure (#605 / 06-S-12)**: the writer marks an item handle advised before the call; a thrown advise (not just a non-OK status) now unmarks it, fails the write closed and re-advises on the next write. diff --git a/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Galaxy/GalaxyDriver.cs b/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Galaxy/GalaxyDriver.cs index 16976b42a..a929643da 100644 --- a/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Galaxy/GalaxyDriver.cs +++ b/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Galaxy/GalaxyDriver.cs @@ -110,6 +110,12 @@ public sealed class GalaxyDriver private readonly System.Collections.Concurrent.ConcurrentDictionary _alarmFullRefByRawPath = new(StringComparer.OrdinalIgnoreCase); + // lmxopcua#895 review: a tag hand-authored with the provider-qualified form ("Galaxy!..") + // indexed by its area-free ".", so its alarms still resolve after Galaxy moves the object to + // another area (the feed's full reference then names the new area and no longer matches the authored one). + // Built once with the raw-tag tables; read-only afterwards. + private readonly Dictionary _rawTagByAreaFreeRef; + // PR 4.4 — subscription lifecycle. The pump consumes the gw event stream and fans // out OnDataChange events to every registered driver subscription via the registry's // reverse map. The subscriber is the test seam — production uses @@ -401,6 +407,7 @@ public sealed class GalaxyDriver // Build the v3 RawPath ⇄ attributeRef tables from the authored raw tags. Empty when no tags // are authored (live-browse path), leaving every translation an identity no-op. (_attributeRefByRawPath, _rawTagByAttributeRef) = BuildRawTagTables(_options.RawTags, _logger, _skippedTags); + _rawTagByAreaFreeRef = BuildAreaFreeAlarmIndex(_rawTagByAttributeRef, _logger); // Forward the aggregator's transitions through IHostConnectivityProbe. _hostStatuses.OnHostStatusChanged += (_, args) => OnHostStatusChanged?.Invoke(this, args); @@ -477,34 +484,75 @@ public sealed class GalaxyDriver /// Resolves the RawPath an alarm-feed transition belongs to (lmxopcua#895). The authored attributeRef /// is matched against, in order: the transition's full reference (a tag authored with the /// provider-qualified Galaxy!Area.tag.Attr form), its SourceObjectReference - /// (tag.Attr — the form the AdminUI Galaxy picker authors), and the full reference with its - /// Provider!Area. prefix stripped. Identity on a miss, as before. A match through either - /// fallback records the full reference for . + /// (tag.Attr — the form the AdminUI Galaxy picker authors), the full reference with its + /// Provider!Area. prefix stripped (the subtag provider sends only the object as its source), and the + /// full reference after its Provider! (an empty area). Those area-free names are then tried against + /// the hand-authored Galaxy!Area.tag.Attr refs by their own area-free part, so a re-areaed object + /// still resolves. Identity on a miss, as before. A match through any fallback records the full reference + /// for (latest wins, so a re-area is picked up on the next transition). /// /// The feed's provider-qualified alarm reference. /// The feed's source reference (tag.Attr), may be empty. /// The authored RawPath, or when no authored tag matches. internal string ResolveAlarmRawPath(string alarmFullReference, string? sourceObjectReference) { + if (string.IsNullOrEmpty(alarmFullReference)) return alarmFullReference; if (_rawTagByAttributeRef.TryGetValue(alarmFullReference, out var direct)) return direct.RawPath; - if (!string.IsNullOrEmpty(sourceObjectReference) - && _rawTagByAttributeRef.TryGetValue(sourceObjectReference, out var bySource)) - { - _alarmFullRefByRawPath[bySource.RawPath] = alarmFullReference; - return bySource.RawPath; - } - + // The feed's area-free name for the alarm. The alarmmgr provider sends it as SourceObjectReference; the + // subtag fallback sends only the object there, so it is also derived from the full reference — with the + // area segment stripped, or (a reference composed with an empty area, "Galaxy!tag.Attr") everything + // after the '!'. var stripped = StripProviderAndArea(alarmFullReference); - if (stripped is not null && _rawTagByAttributeRef.TryGetValue(stripped, out var byStripped)) + var afterBang = AfterProvider(alarmFullReference); + string?[] candidates = [sourceObjectReference, stripped, afterBang]; + + // Picker form first (attributeRef = tag.Attr), then a hand-authored Galaxy!.tag.Attr whose object + // Galaxy has since moved to another area. + foreach (var table in (Dictionary[])[_rawTagByAttributeRef, _rawTagByAreaFreeRef]) { - _alarmFullRefByRawPath[byStripped.RawPath] = alarmFullReference; - return byStripped.RawPath; + foreach (var candidate in candidates) + { + if (string.IsNullOrEmpty(candidate) || !table.TryGetValue(candidate, out var entry)) continue; + _alarmFullRefByRawPath[entry.RawPath] = alarmFullReference; + return entry.RawPath; + } } return alarmFullReference; } + /// + /// Index the provider-qualified authored attributeRefs (Galaxy!Area.tag.Attr) by their area-free + /// tag.Attr (lmxopcua#895 review). First wins on a shared key; an area-free key that is also authored + /// as a plain attributeRef is left to the plain entry. Both overlaps are logged, since the losing tag's + /// alarms then surface under another RawPath. + /// + private static Dictionary BuildAreaFreeAlarmIndex( + Dictionary rawTagByAttributeRef, ILogger logger) + { + var index = new Dictionary(StringComparer.OrdinalIgnoreCase); + foreach (var (attributeRef, entry) in rawTagByAttributeRef) + { + var areaFree = StripProviderAndArea(attributeRef); + if (areaFree is null) continue; + if (rawTagByAttributeRef.TryGetValue(areaFree, out var plain)) + { + logger.LogWarning( + "GalaxyDriver raw tags {RawPath} ({AttributeRef}) and {PlainRawPath} ({AreaFreeRef}) name the same Galaxy alarm — its transitions surface under {RawPath} while the area matches, otherwise under {PlainRawPath}.", + entry.RawPath, attributeRef, plain.RawPath, areaFree, entry.RawPath, plain.RawPath); + continue; + } + if (!index.TryAdd(areaFree, entry)) + { + logger.LogWarning( + "GalaxyDriver raw tags {RawPath} ({AttributeRef}) and {Winner} name the same Galaxy alarm {AreaFreeRef} in different areas — a transition from any other area surfaces under {Winner} only.", + entry.RawPath, attributeRef, index[areaFree].RawPath, areaFree, index[areaFree].RawPath); + } + } + return index; + } + /// /// The reference an acknowledge of the condition dials: the provider-qualified /// reference the alarm feed reported for it when one was learned (lmxopcua#895), otherwise the authored @@ -525,6 +573,13 @@ public sealed class GalaxyDriver return dot < 0 || dot == alarmFullReference.Length - 1 ? null : alarmFullReference[(dot + 1)..]; } + /// Galaxy!tag.Attr → tag.Attr; null without a ! or with nothing after it. + private static string? AfterProvider(string alarmFullReference) + { + var bang = alarmFullReference.IndexOf('!'); + return bang < 0 || bang == alarmFullReference.Length - 1 ? null : alarmFullReference[(bang + 1)..]; + } + /// public string DriverInstanceId => _driverInstanceId; @@ -2817,6 +2872,15 @@ public sealed class GalaxyDriver // subscription gate below, which only governs fan-out to OnAlarmEvent. _ackConfirmations.Observe(transition); + // v3: the ConditionId the driver reports must be the tag's RawPath — the same key the value + // fan-out uses (OnPumpDataChange) and the identity the discoverer stamped as SourceName — so the + // server-side condition state correlates the alarm to its node and a subsequent ack round-trips + // back through AcknowledgeAsync. The feed reports the provider-qualified reference + // (Galaxy!Area.tag.Attr); reverse-map it to the authored tag, also through the plain tag.Attr form the + // AdminUI picker authors (lmxopcua#895), identity on a miss. Resolved ahead of the subscription gate so + // every transition the driver sees teaches the ack reference, fanned out or not. + var conditionRawPath = ResolveAlarmRawPath(transition.AlarmFullReference, transition.SourceObjectReference); + GalaxyAlarmSubscriptionHandle? handle; int subCount; lock (_alarmHandlersLock) @@ -2841,13 +2905,6 @@ public sealed class GalaxyDriver transition.TransitionKind, transition.AlarmFullReference, subCount, handle is not null); if (handle is null) return; - // v3: the ConditionId the driver reports must be the tag's RawPath — the same key the value - // fan-out uses (OnPumpDataChange) and the identity the discoverer stamped as SourceName — so the - // server-side condition state correlates the alarm to its node and a subsequent ack round-trips - // back through AcknowledgeAsync. The feed reports the provider-qualified reference - // (Galaxy!Area.tag.Attr); reverse-map it to the authored tag, also through the plain tag.Attr form the - // AdminUI picker authors (lmxopcua#895), identity on a miss. - var conditionRawPath = ResolveAlarmRawPath(transition.AlarmFullReference, transition.SourceObjectReference); var args = new AlarmEventArgs( SubscriptionHandle: handle, SourceNodeId: transition.SourceObjectReference, diff --git a/tests/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Galaxy.Tests/Runtime/GalaxyDriverRawPathKeyingTests.cs b/tests/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Galaxy.Tests/Runtime/GalaxyDriverRawPathKeyingTests.cs index d6db935be..892e2593e 100644 --- a/tests/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Galaxy.Tests/Runtime/GalaxyDriverRawPathKeyingTests.cs +++ b/tests/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Galaxy.Tests/Runtime/GalaxyDriverRawPathKeyingTests.cs @@ -206,6 +206,155 @@ public sealed class GalaxyDriverRawPathKeyingTests driver.ToAlarmAckReference("Galaxy!Area1.Other.Attr").ShouldBe("Galaxy!Area1.Other.Attr"); } + // ===== lmxopcua#895 review: area changes, subtag-provider shape, collisions, ack confirmation ===== + + private const string OtherRawPath = "area/line/tank1/level-hand"; + + private static GalaxyDriverOptions Opts(params (string RawPath, string AttributeRef)[] tags) => OptsWithRawTags() with + { + RawTags = [.. tags.Select(t => new RawTagEntry(t.RawPath, $"{{\"attributeRef\":\"{t.AttributeRef}\"}}", false))], + }; + + /// Galaxy moves a picker-authored tag's object to another area: the transition still resolves (via the + /// unchanged source reference) and the ack follows the latest area the feed named. + [Fact] + public void PickerForm_AfterReArea_ResolvesAndAckFollowsTheNewArea() + { + using var driver = new GalaxyDriver("g", OptsWithRawTags(), hierarchySource: null); + + driver.ResolveAlarmRawPath("Galaxy!Area1.Tank1.Level", AttributeRef).ShouldBe(RawPath); + driver.ResolveAlarmRawPath("Galaxy!Area2.Tank1.Level", AttributeRef).ShouldBe(RawPath); + + driver.ToAlarmAckReference(RawPath).ShouldBe("Galaxy!Area2.Tank1.Level"); + } + + /// A tag hand-authored as Galaxy!Area1.tag.Attr keeps resolving after Galaxy re-areas the object + /// (before the review fix the feed's Galaxy!Area2… matched nothing and every transition was dropped), and + /// its ack dials the reference the feed now uses. + [Fact] + public void HandAuthoredProviderForm_AfterReArea_ResolvesAndAcksTheNewArea() + { + using var driver = new GalaxyDriver("g", Opts((RawPath, "Galaxy!Area1.Tank1.Level")), hierarchySource: null); + + driver.ToAlarmAckReference(RawPath).ShouldBe("Galaxy!Area1.Tank1.Level"); + driver.ResolveAlarmRawPath("Galaxy!Area2.Tank1.Level", "Tank1.Level").ShouldBe(RawPath); + driver.ToAlarmAckReference(RawPath).ShouldBe("Galaxy!Area2.Tank1.Level"); + } + + /// The gateway's subtag (degraded) provider sends only the object as the source reference. The + /// area-stripped full reference resolves it, and a reference composed with an empty area + /// (Galaxy!tag.Attr) resolves through what follows the !. + [Theory] + [InlineData("Galaxy!Area1.Tank1.Level", "Tank1")] + [InlineData("Galaxy!Tank1.Level", "Tank1")] + [InlineData("Galaxy!Tank1.Level", "")] + [InlineData("Galaxy!Area1.Tank1.Level", null)] + public void SubtagProviderShapes_Resolve(string fullRef, string? source) + { + using var driver = new GalaxyDriver("g", OptsWithRawTags(), hierarchySource: null); + + driver.ResolveAlarmRawPath(fullRef, source).ShouldBe(RawPath); + driver.ToAlarmAckReference(RawPath).ShouldBe(fullRef); + } + + /// H6-style contained/dotted references: the object's tag_name (not its contained hierarchy) is what + /// the feed and the picker share, and an alarm attribute nested under another attribute keeps its dots. + [Theory] + [InlineData("TableAlarms_008.RuntimeAlert", "Galaxy!CVDAisle_1.TableAlarms_008.RuntimeAlert", "TableAlarms_008.RuntimeAlert")] + [InlineData("TableAlarms_008.RuntimeAlert", "Galaxy!CVDAisle_1.TableAlarms_008.RuntimeAlert", "TableAlarms_008")] + [InlineData("Tank1.Level.HiHi", "Galaxy!Area1.Tank1.Level.HiHi", "Tank1")] + public void DottedAndContainedReferences_Resolve(string attributeRef, string fullRef, string source) + { + using var driver = new GalaxyDriver("g", Opts((RawPath, attributeRef)), hierarchySource: null); + + driver.ResolveAlarmRawPath(fullRef, source).ShouldBe(RawPath); + driver.ToAlarmAckReference(RawPath).ShouldBe(fullRef); + } + + /// Feed references that match nothing — or are malformed — keep the identity fallback, never throw, and + /// teach nothing (no authored RawPath's ack reference changes). + [Theory] + [InlineData("Galaxy!Area1.Other.Attr", "Other.Attr")] + [InlineData("Galaxy!Area1.Other.Attr", "Other")] + [InlineData("Galaxy!", "")] + [InlineData("Galaxy!Area1.", null)] + [InlineData("NoBang.Tank1", "")] + [InlineData("", "")] + public void UnmatchedOrMalformed_KeepsIdentity_AndLearnsNothing(string fullRef, string? source) + { + using var driver = new GalaxyDriver("g", OptsWithRawTags(), hierarchySource: null); + + driver.ResolveAlarmRawPath(fullRef, source).ShouldBe(fullRef); + driver.ToAlarmAckReference(RawPath).ShouldBe(AttributeRef); + } + + /// The same Galaxy alarm authored twice — picker form and hand-authored provider form. Deterministic: the + /// exact provider-form match wins while the area matches; any other area surfaces under the picker tag. + [Fact] + public void PickerAndHandAuthoredOfTheSameAlarm_ResolveDeterministically() + { + using var driver = new GalaxyDriver( + "g", Opts((RawPath, AttributeRef), (OtherRawPath, "Galaxy!Area1.Tank1.Level")), hierarchySource: null); + + driver.ResolveAlarmRawPath("Galaxy!Area1.Tank1.Level", AttributeRef).ShouldBe(OtherRawPath); + driver.ResolveAlarmRawPath("Galaxy!Area2.Tank1.Level", AttributeRef).ShouldBe(RawPath); + driver.ToAlarmAckReference(RawPath).ShouldBe("Galaxy!Area2.Tank1.Level"); + driver.ToAlarmAckReference(OtherRawPath).ShouldBe("Galaxy!Area1.Tank1.Level"); + } + + /// A transition that arrives while no alarm subscription is registered is not fanned out, but it still + /// teaches the ack reference (the feed starts before SubscribeAlarmsAsync registers its handle). + [Fact] + public async Task TransitionWithoutSubscription_StillTeachesTheAckReference() + { + var feed = new FakeAlarmFeed(); + var ack = new RecordingAcknowledger(); + using var driver = new GalaxyDriver( + "g", OptsWithRawTags(), hierarchySource: null, alarmAcknowledger: ack, alarmFeed: feed, + ackCredentialResolver: FixedAckCredentialResolver.Fallback()); + var handle = await driver.SubscribeAlarmsAsync(["Tank1"], CancellationToken.None); + await driver.UnsubscribeAlarmsAsync(handle, CancellationToken.None); + var observed = new List(); + driver.OnAlarmEvent += (_, args) => observed.Add(args); + + feed.Emit(NewTransition("Galaxy!Area1.Tank1.Level", AttributeRef)); + await driver.AcknowledgeAsync( + [new AlarmAcknowledgeRequest("Tank1", RawPath, "ack it")], CancellationToken.None); + + observed.ShouldBeEmpty(); + ack.Calls.ShouldHaveSingleItem().AlarmRef.ShouldBe("Galaxy!Area1.Tank1.Level"); + } + + /// lmxopcua#869 with the picker form: an ack the gateway only SENT is confirmed by Galaxy's acknowledged + /// transition, which names the provider-qualified reference — the one the ack now dials. + [Fact] + public async Task PickerForm_UnconfirmedAck_IsConfirmedByTheFeedsAcknowledgedTransition() + { + const string fullRef = "Galaxy!Area1.Tank1.Level"; + var feed = new FakeAlarmFeed(); + var opts = OptsWithRawTags() with { AlarmAck = new GalaxyAlarmAckOptions { ConfirmTimeoutMs = 120_000 } }; + using var driver = new GalaxyDriver( + "g", opts, hierarchySource: null, alarmAcknowledger: new UnconfirmedAcknowledger(), alarmFeed: feed, + ackCredentialResolver: FixedAckCredentialResolver.Fallback()); + await driver.SubscribeAlarmsAsync(["Tank1"], CancellationToken.None); + feed.Emit(NewTransition(fullRef, AttributeRef)); + AlarmAcknowledgeRequest[] request = [new AlarmAcknowledgeRequest("Tank1", RawPath, "ack it")]; + + await driver.AcknowledgeAsync(request, CancellationToken.None); + var confirm = driver.ConfirmAcknowledgedAsync(request, CancellationToken.None); + confirm.IsCompleted.ShouldBeFalse(); + feed.Emit(NewTransition(fullRef, AttributeRef) with { TransitionKind = GalaxyAlarmTransitionKind.Acknowledge }); + + await TestWait.ForAsync(confirm, "the feed's acknowledged transition must confirm the picker-form ack"); + } + + private sealed class UnconfirmedAcknowledger : IGalaxyAlarmAcknowledger + { + public Task AcknowledgeAsync( + string alarmFullReference, string comment, GalaxyAckCredential credential, CancellationToken cancellationToken) + => Task.FromResult(GalaxyAckOutcome.Unconfirmed("sent; OnWriteComplete not observed")); + } + // ===== helpers / fakes ===== private static GalaxyAttribute Attr(string name, int sec)