fix: avoid replaying superseded compaction summaries

This commit is contained in:
amosblomqvist
2026-10-26 19:08:15 +02:00
parent 3dc88472ee
commit b81f0a3455
6 changed files with 191 additions and 13 deletions
+3 -3
View File
@@ -272,9 +272,9 @@ export function newCompactionMarker(summary: string, details: CompactionDetails)
};
}
/** The ACTIVE compaction marker: the newest one in the record (chained
* compactions — the last one rules; older markers fall inside the
* dropped span and never render). */
/** The ACTIVE compaction marker: the newest one with a retained-message
* id. Its summary supersedes older markers even when their stored
* positions remain inside its retained tail. */
export function activeCompactionOf(messages: readonly LhMessage[]): (LhMarkerMessage & { details: CompactionDetails }) | null {
for (let i = messages.length - 1; i >= 0; i--) {
const m = messages[i]!;