fix(historian): #691.2 serve reverse native TimeAverage/Total on Gateway via forward reads on the later-anchored #677 grid

This commit is contained in:
Joseph Doherty
2026-10-12 16:17:05 -04:00
parent dbffb6bdb4
commit 0e47e887de
7 changed files with 349 additions and 6 deletions
@@ -106,9 +106,11 @@ public sealed class GatewayNativeAggregateRowsTests
public async Task The_window_filter_is_direction_agnostic()
{
// A reverse request (start > end) covers the same span (end, start]; a row for the interval before the span is out.
// #691.2: served by a forward request on the later-anchored grid, newest first, stamped with each later edge.
var wire = new[] { Row(T0 - I20, T0, 9, 192), Row(T0, T0 + I20, 1, 192), Row(T0 + I20, T0 + 2 * I20, 2, 192) };
var s = await Read(wire, T0 + 2 * I20, T0);
s.Select(x => x.Value).ShouldBe(new object?[] { 1d, 2d });
s.Select(x => x.Value).ShouldBe(new object?[] { 2d, 1d });
s.Select(x => x.SourceTimestampUtc).ShouldBe(new DateTime?[] { T0 + 2 * I20, T0 + I20 });
}
// ---- D2: an Uncertain row keeps its value ------------------------------------------------------------------------