fix(grpc-data): H2 review2-7c - MaxHistoryResponseBytes minimum 256 KiB (validator + AdminUI min)

Wire tests that relied on a 1-byte response cap now exercise chunking with wide string values at the minimum.
This commit is contained in:
Joseph Doherty
2026-11-23 23:18:08 -05:00
parent a3da73e1e7
commit fc8154289d
4 changed files with 26 additions and 17 deletions
@@ -26,6 +26,8 @@ public static class DataConnectionValidator
public const int MaxHistoryValuesPerPageLimit = 1_000_000;
/// <summary>Largest <c>DataExport.MaxHistoryResponseBytes</c> (64 MiB).</summary>
public const int MaxHistoryResponseBytesLimit = 64 * 1024 * 1024;
/// <summary>Smallest <c>DataExport.MaxHistoryResponseBytes</c> (256 KiB): below it a page of ordinary values cannot fit.</summary>
public const int MinHistoryResponseBytesLimit = 256 * 1024;
/// <summary>Largest <c>RemoteNamespaceMapping.MaxHistoryAssemblyBytesPerRequest</c> (1 GiB).</summary>
public const int MaxHistoryAssemblyBytesLimit = 1024 * 1024 * 1024;
@@ -303,7 +305,7 @@ public static class DataConnectionValidator
if (export.MaxBatchItems <= 0 || export.MaxPageItems <= 0 || export.MaxMonitoredItems <= 0 || export.MaxStreams <= 0 ||
export.MaxConcurrentHistoryReads <= 0 || export.MaxConcurrentHistoryReads > MaxConcurrentHistoryReadsLimit ||
export.MaxHistoryValuesPerPage <= 0 || export.MaxHistoryValuesPerPage > MaxHistoryValuesPerPageLimit ||
export.MaxHistoryResponseBytes <= 0 || export.MaxHistoryResponseBytes > MaxHistoryResponseBytesLimit)
export.MaxHistoryResponseBytes < MinHistoryResponseBytesLimit || export.MaxHistoryResponseBytes > MaxHistoryResponseBytesLimit)
Add("DataExportLimitInvalid", id, "Export limits must be positive.");
}
return errors;
@@ -89,7 +89,7 @@ else
@Operations(e.AllowedOperations, v => e.AllowedOperations = v)
<label class="form-label" for="export-history-reads">Concurrent history reads per peer</label><input id="export-history-reads" type="number" min="1" max="@DataConnectionValidator.MaxConcurrentHistoryReadsLimit" class="form-control mb-2" @bind="e.MaxConcurrentHistoryReads" />
<label class="form-label" for="export-history-page">History values per page</label><input id="export-history-page" type="number" min="1" max="@DataConnectionValidator.MaxHistoryValuesPerPageLimit" class="form-control mb-2" @bind="e.MaxHistoryValuesPerPage" />
<label class="form-label" for="export-history-bytes">History response bytes</label><input id="export-history-bytes" type="number" min="1" max="@DataConnectionValidator.MaxHistoryResponseBytesLimit" class="form-control mb-2" @bind="e.MaxHistoryResponseBytes" /><div class="form-text">Larger answers are sent in bounded chunks.</div>
<label class="form-label" for="export-history-bytes">History response bytes</label><input id="export-history-bytes" type="number" min="@DataConnectionValidator.MinHistoryResponseBytesLimit" max="@DataConnectionValidator.MaxHistoryResponseBytesLimit" class="form-control mb-2" @bind="e.MaxHistoryResponseBytes" /><div class="form-text">Larger answers are sent in bounded chunks.</div>
<label><input type="checkbox" @bind="e.Enabled" /> Enabled in next deployment</label>@Actions(e, e.DataExportRowId != Guid.Empty)
</div></section>
}