fix(grpc-data): H2 review2-7a - no aggregates or resolution for a peer without a HistoryRead grant
The history field still marks that the origin has a historian (negotiation rule unchanged), but a principal with no HistoryRead export sees no aggregate names and resolution 0 (undisclosed).
This commit is contained in:
@@ -63,7 +63,9 @@ public sealed partial class LocalDataServices
|
||||
internal DataHistoryCapabilities? HistoryCapabilitiesFor(LocalExportCatalog? catalog, DataAuthenticatedContext context)
|
||||
{
|
||||
if (HistoryServing is not { } serving) return null;
|
||||
var limits = catalog?.HistoryLimitsFor(context.PrincipalId) ?? (4, 10_000, 4 * 1024 * 1024);
|
||||
// Without a HistoryRead grant on some export the peer learns that history exists here, and nothing about it.
|
||||
if (catalog?.HistoryLimitsFor(context.PrincipalId) is not { } limits)
|
||||
return new DataHistoryCapabilities(false, false, false, [], 0, 10_000, 4, PeerHistoryIdle);
|
||||
return new DataHistoryCapabilities(true, serving.Aggregates.Count > 0, true, serving.Aggregates, serving.TimestampResolutionTicks,
|
||||
limits.ValuesPerPage, limits.ConcurrentReads, PeerHistoryIdle);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user