mirror of
https://github.com/supabase/supabase.git
synced 2026-10-12 04:45:08 +03:00
Merge pull request #14655 from supabase/fix/prevent-filling-10k-datapoints
fix: prevent accidental filing of large timeseries datasets
This commit is contained in:
1 file changed
+6
@@ -394,6 +394,12 @@ export const fillTimeseries = (
|
||||
})
|
||||
|
||||
const diff = maxDate.diff(minDate, truncation as dayjs.UnitType)
|
||||
// Intentional throwing of error here to be caught by Sentry, as this would indicate a bug since charts shouldn't be rendering more than 10k data points
|
||||
if (diff > 10000) {
|
||||
throw new Error(
|
||||
'Data error, filling timeseries dynamically with more than 10k data points degrades performance.'
|
||||
)
|
||||
}
|
||||
for (let i = 0; i <= diff; i++) {
|
||||
const dateToMaybeAdd = minDate.add(i, truncation as dayjs.ManipulateType)
|
||||
|
||||
|
||||
Reference in new issue
Block a user