docs(snapshot): dedup-tie-break dokumentiert
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
63b68411e4
commit
49c740d908
|
|
@ -2,6 +2,8 @@ import type { SignedEvent } from './types.ts'
|
||||||
|
|
||||||
export function dedupByDtag(events: SignedEvent[]): SignedEvent[] {
|
export function dedupByDtag(events: SignedEvent[]): SignedEvent[] {
|
||||||
const byDtag = new Map<string, SignedEvent>()
|
const byDtag = new Map<string, SignedEvent>()
|
||||||
|
// Bei gleicher created_at gewinnt das zuerst gesehene event (relay-delivery-
|
||||||
|
// reihenfolge ist nicht-deterministisch, equal-timestamp = aequivalent).
|
||||||
for (const ev of events) {
|
for (const ev of events) {
|
||||||
const d = ev.tags.find((t) => t[0] === 'd')?.[1]
|
const d = ev.tags.find((t) => t[0] === 'd')?.[1]
|
||||||
if (!d) continue
|
if (!d) continue
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue