Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(session-replay): sort session timestamps chronologically (#68835)

Frank Hamand6a44e822f84a
diff --git a/frontend/src/scenes/session-recordings/playlist/sessionRecordingsListPropertiesLogic.ts b/frontend/src/scenes/session-recordings/playlist/sessionRecordingsListPropertiesLogic.ts
index a5924d067c5d..a78061c10669 100644
--- a/frontend/src/scenes/session-recordings/playlist/sessionRecordingsListPropertiesLogic.ts
+++ b/frontend/src/scenes/session-recordings/playlist/sessionRecordingsListPropertiesLogic.ts
@@ -91,8 +91,10 @@ export const sessionRecordingsListPropertiesLogic = kea<sessionRecordingsListPro
const startTime = performance.now()
const sessionIds = sessions.map((x) => x.id)
- const oldestTimestamp = sessions.map((x) => x.start_time).sort()[0]
- const newestTimestamp = sessions.map((x) => x.end_time).sort()[sessions.length - 1]
+ const chronological = (a: string, b: string): number =>
+ new Date(a).getTime() - new Date(b).getTime()
+ const oldestTimestamp = sessions.map((x) => x.start_time).sort(chronological)[0]
+ const newestTimestamp = sessions.map((x) => x.end_time).sort(chronological)[sessions.length - 1]
const extraSessionProperties = values.extraSessionProperties
let response