mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-09 16:14:40 +00:00
Reviewer Vitor (PR #3483): stop blasting kind 0/3 REQs at a static index relay list. Use NIP-65: index relays discover each author's kind-10002, then per-author kind 0/3 REQs go to that author's declared write relays. New in commons/commonMain: - OutboxCacheGateway — platform-agnostic bridge to the local event cache. Three ops: cachedOutbox(pubkey), onOutboxDiscovered(event, relay), onDiscoveredEvent(event, relay). - OutboxDispatcher — three-phase pipeline reusing Quartz's existing RelayListRecommendationProcessor.reliableRelaySetFor(...) for the author→relay inversion + minimal-cover algorithm. Phase 1: REQ kind-10002 for authors not already cached, from index relays. Per-relay 4s timeout. Phase 2: reliable-relay-set → per-outbox-relay REQ for kind 0 and/or kind 3 filtered to that relay's authors. Phase 3: index-relay fallback for authors that never returned a 10002. Preserves current behaviour on cold accounts. Retries the "not in kind*Succeeded and not in kind*InFlight" set so a zero-EOSE run is retryable on the next call. New in DesktopLocalCache: - route() branch for AdvertisedRelayListEvent (kind 10002) storing in addressableNotes so cachedAdvertisedRelayList(pubkey) can serve future lookups without a REQ. - cachedAdvertisedRelayList(pubkey): AdvertisedRelayListEvent? — the gateway's peek into the cache for Phase-1 skipping. Tests (7): cached-outbox-skips-Phase-1, Phase-1-discovers-then-Phase-2, Phase-3-fallback-for-no-10002, cached-author-covered-when-Phase-1-hangs, clear-releases-dedup, concurrent-EOSE-safety. Plan: commons/plans/2026-07-06-fix-wot-outbox-model-and-review-fixes-plan.md