fix(bd-9ah): use sequence-based ordering in web SessionReplay

The web frontend SessionReplay component was sorting events by
timestamp, inconsistent with all other consumers (store, TUI replay,
export, analytics, narrative) which use compareEventsBySequence.
Switched to the canonical (worker, sequence) ordering so multi-host
OTLP ingestion produces correct replay order despite clock skew.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
jedarden 2026-04-21 13:34:37 -04:00
parent 7210fdf323
commit 039f692fb4

View file

@ -7,7 +7,7 @@
*/
import React, { useState, useEffect, useCallback, useRef } from 'react';
import { LogEvent, ReplaySpeed, ReplayState } from '../types';
import { LogEvent, ReplaySpeed, ReplayState, compareEventsBySequence } from '../types';
import {
exportToBase64Browser,
importFromBase64Browser,
@ -94,9 +94,7 @@ const SessionReplay: React.FC<SessionReplayProps> = ({
// Filter events
const filteredEvents = React.useMemo(() => {
let filtered = [...events].sort((a, b) =>
new Date(a.timestamp).getTime() - new Date(b.timestamp).getTime()
);
let filtered = [...events].sort(compareEventsBySequence);
if (filterWorker) {
filtered = filtered.filter(e => e.worker === filterWorker);