From 588e665b3810fc0cf1b0a3a0a5d747452b3b852f Mon Sep 17 00:00:00 2001 From: David Newell Date: Mon, 9 Oct 2023 11:55:01 +0100 Subject: [PATCH] add validity check --- plugin-server/src/worker/ingestion/process-event.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugin-server/src/worker/ingestion/process-event.ts b/plugin-server/src/worker/ingestion/process-event.ts index b057c0d97d162..1de223fdcf0d1 100644 --- a/plugin-server/src/worker/ingestion/process-event.ts +++ b/plugin-server/src/worker/ingestion/process-event.ts @@ -407,7 +407,9 @@ export const createSessionReplayEvent = ( const timestamps = events .filter((e) => !!e?.timestamp) .filter((e) => Math.sign(e.timestamp) === 1) - .map((e) => castTimestampOrNow(DateTime.fromMillis(e.timestamp), TimestampFormat.ClickHouse)) + .map((e) => DateTime.fromMillis(e.timestamp)) + .filter((e) => e.isValid) + .map((e) => castTimestampOrNow(e, TimestampFormat.ClickHouse)) .sort() // but every event where chunk index = 0 must have an eventsSummary