Files
ngit-grasp/tests/sync
DanConwayDev e02d3d778c fix(sync): retire obsolete relay ownership passively
Repository addressable announcements replace their relay lists, but the sync index previously unioned every URL ever observed. Superseded relays therefore remained live indefinitely, and fully expired purgatory ownership survived after its revival window.

Replace announcement-owned relay sets in SelfSubscriber, reconcile StateOnly purgatory ownership from each current snapshot, and treat queued actions as dirty-relay signals recomputed against current state. Ownership removal deliberately leaves healthy connections and subscriptions alone. A natural live CLOSED rebuilds coverage from the current index; a natural connection end reconciles confirmed state, reconnecting shared relays with current items and retiring wholly unowned relays.

Correctness assumes addressable kind 30617 replacement semantics and that root events add sync work without changing announcement ownership. Soft-expired purgatory entries remain until the snapshot drops them, and promoted Full entries are never downgraded. Multi-relay fan-out policy and active session compaction are excluded.

Validation: cargo test --lib passed (665 tests). The passive-retirement integration scenario passed and proves replacement keeps the old session live until the source naturally disconnects, after which it is not reconnected. The broader live_sync selection passed 4/5; test_live_sync_layer3_events failed identically standalone on the unchanged 35894d7 base, confirming an existing unrelated regression.
2026-08-08 11:56:50 +00:00
..