Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

fix sessionreplay seek issues

Francis Cao66a5881fde8f
diff --git a/src/app/api/websites/[websiteId]/replays/[replayId]/route.ts b/src/app/api/websites/[websiteId]/replays/[replayId]/route.ts
index eb030c163..ff9a685aa 100644
--- a/src/app/api/websites/[websiteId]/replays/[replayId]/route.ts
+++ b/src/app/api/websites/[websiteId]/replays/[replayId]/route.ts
@@ -21,7 +21,9 @@ export async function GET(
const chunks = await getReplayChunks(websiteId, replayId);
- const allEvents = chunks.flatMap(chunk => chunk.events);
+ const allEvents = chunks
+ .flatMap(chunk => chunk.events)
+ .sort((a, b) => a.timestamp - b.timestamp);
const sessionId = chunks.length > 0 ? chunks[0].sessionId : null;
const startedAt = chunks.length > 0 ? chunks[0].startedAt : null;
const endedAt = chunks.length > 0 ? chunks[chunks.length - 1].endedAt : null;