mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-09 08:04:45 +00:00
Splits the reconcile out of negentropySync so callers decide how to load: negentropyReconcile streams needIds (relay has, local lacks — download) and haveIds (local has, relay lacks — publish) in batchSize chunks with back-pressure, taking local state as List<IdAndTime> and slicing it per created_at window on overflow splits; the accumulating negentropyReconcileIds convenience returns both lists. negentropySync now delegates to the same window engine. NegentropySession's primary constructor takes List<IdAndTime> (JVM erasure forbids a List<Event> overload); the event-list form moved to NegentropySession.fromEvents, mirroring NegentropyServerSession, with all call sites migrated. Adds NostrClientNegentropyReconcileTest (empty local set, partial overlap both directions, identical sets, batch streaming, since/until window slicing) — 49 negentropy tests green. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018saXqYfAa3RvSJoDXK591R