mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-09 16:14:40 +00:00
Chat rows render the inner rumor note of a NIP-17 message, but relay attribution only landed there through narrow windows, so accepted relays often never showed as icons: - Duplicate deliveries were stranded on the wrap: a gift wrap re-delivered by a second relay hit the duplicate branch of consumeRegularEvent, which tagged the outer wrap note only and never re-processed the event. Extract the OK-path drilling (wrap -> seal -> rumor) into LocalCache.addRelayToNoteAndInners and call it from both the OK confirmation path (markAsSeen) and the duplicate EVENT path, replacing CacheClientConnector's private copy. - Cross-thread visibility: Note.event, Note.relays, Note.flowSet and the innerEventId of GiftWrapEvent/SealedRumorEvent are written by decrypt/index coroutines and read lock-free on relay socket threads; a stale read parks an acceptance on the outer envelope permanently. Mark them @Volatile. - Orphaned UI flows: RenderClosedRelayList/RenderAllRelayList and createMustShowExpandButtonFlows captured note.flow().relays.stateFlow once in remember/stateIn; MemoryTrimmingService.cleanObservers destroys the unobserved NoteFlowSet while the lifecycle is stopped, so resumed rows never saw another relay update. Wrap in a cold flow that re-resolves flow() on every collection start. - Indexing latency: sent DMs waited for the ~1s newEventBundles batcher before the self-wrap was unwrapped and the message reached the chatroom, parking early OKs on the wrap. broadcastPrivately and sendNip04PrivateMessage now run the EventProcessor on the freshly consumed note immediately; the batched re-delivery is idempotent. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YEiq1NMK3q12KGQ2yYhPEp