SYNC: charts UX, error handling, bucket count limit

This commit is contained in:
SPRINX0\prochazka
2025-06-19 14:07:38 +02:00
committed by Diflow
parent ff1b688b6e
commit adef9728f8
3 changed files with 30 additions and 1 deletions

View File

@@ -527,6 +527,7 @@ export function fillChartTimelineBuckets(chart: ProcessedChart) {
const transform = chart.definition.xdef.transformFunction;
let currentParsed = fromParsed;
let count = 0;
while (compareChartDatesParsed(currentParsed, toParsed, transform) <= 0) {
const bucketKey = stringifyChartDate(currentParsed, transform);
if (!chart.buckets[bucketKey]) {
@@ -534,6 +535,11 @@ export function fillChartTimelineBuckets(chart: ProcessedChart) {
chart.bucketKeyDateParsed[bucketKey] = currentParsed;
}
currentParsed = incrementChartDate(currentParsed, transform);
count++;
if (count > ChartLimits.CHART_FILL_LIMIT) {
chart.errorMessage = `Too many buckets to fill in chart, limit is ${ChartLimits.CHART_FILL_LIMIT}`;
return;
}
}
}