Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

add in additional data points only if before the latest data point

TzeYiing174522a38d10
diff --git a/studio/components/interfaces/Settings/Logs/LogEventChart.tsx b/studio/components/interfaces/Settings/Logs/LogEventChart.tsx
index 56c69944855..2e6abb81906 100644
--- a/studio/components/interfaces/Settings/Logs/LogEventChart.tsx
+++ b/studio/components/interfaces/Settings/Logs/LogEventChart.tsx
@@ -54,12 +54,13 @@ const useAggregated = (data: LogData[]) => {
if (!oldestEvent) return []
const currentTimestamp = new Date().getTime()
const oldestTimestampMicro = oldestEvent.timestamp
+ const latestTimestamp = truncateToMinute(data[0]['timestamp'])
const minutesDifference = Math.round(
(currentTimestamp - oldestTimestampMicro / 1000) / 1000 / 60
)
for (const minToAdd of Array.from(Array(minutesDifference).keys())) {
const tsToCheck = truncateToMinute(oldestTimestampMicro) + minToAdd * 60
- if (!(tsToCheck in countMap)) {
+ if (!(tsToCheck in countMap) && tsToCheck <= latestTimestamp) {
countMap[tsToCheck] = 0
}
}