fix(dataconn): #957 /raw refuses adding an alarm to an export-root tag; data-connection saves refuse only errors they introduce; ACL-hidden nodes inside a grant answer NotFound

1. RawTreeService.UpdateTagAsync refuses the edit that makes a tag alarm-bearing while it roots an enabled
   DataExport (RawTag, or UnsTagReference to it) with the #942 DataExportRootAlarmBearing text (shared constants).
   DataConnectionAdminService refuses only errors a save/delete introduces or that remain on the saved row, so a
   pre-existing invalid row no longer blocks unrelated rows (two invalid rows used to deadlock); deploy gate unchanged.
2. Origin: GetMetadata/Read/Subscribe/condition admission answer a node inside the grant that the origin ACL hides
   (no Browse and no Read) NotFound, like a missing one (Browse omits it; HistoryRead/Write already uniform). Denied
   stays for visible nodes. Consumer renewal treats NotFound like Denied (#939 Refused), so tightening the ACL on a
   projected node still reads BadUserAccessDenied.
This commit is contained in:
Joseph Doherty
2026-12-01 20:34:22 -05:00
parent e66f072121
commit 285015c9de
14 changed files with 348 additions and 38 deletions
@@ -395,9 +395,11 @@ public sealed class RemoteNamespaceResolver : IFederatedProjectionCatalog, IDisp
elapsed = Clock.GetElapsedTime(started, Clock.GetTimestamp());
if (elapsed < TimeSpan.Zero || elapsed >= budget.Timeout || linked.IsCancellationRequested) return Failed;
// #939: the origin's own verdict on this item — Denied, or a Good answer that no longer grants the operation — is a
// definitive refusal (the consumer answers BadUserAccessDenied), not a lapse to retry.
// definitive refusal (the consumer answers BadUserAccessDenied), not a lapse to retry. #957: so is NotFound — an
// origin answers a node its ACL now hides from this peer (or one outside its grant, #943) exactly like a missing
// one, so for a node this consumer already projected it is the same verdict, not a lapse.
if (results.Count == 1 && results[0].CorrelationId == "0" &&
(results[0].Status == DataItemStatus.Denied ||
(results[0].Status is DataItemStatus.Denied or DataItemStatus.NotFound ||
results[0].Status == DataItemStatus.Good && results[0].Value is { } granted && granted.View == previous.OriginMetadata.View &&
(binding.Mapping.AllowedOperations & required) == required &&
((granted.AllowedOperations & required) == 0 || required == DataOperations.Write && !granted.Writable)))