Skip to content

fix: resolve live stream chat cross-platform visibility#418

Merged
barrydeen merged 1 commit intomainfrom
fix/live-chat-relay-connectivity
Apr 2, 2026
Merged

fix: resolve live stream chat cross-platform visibility#418
barrydeen merged 1 commit intomainfrom
fix/live-chat-relay-connectivity

Conversation

@barrydeen
Copy link
Copy Markdown
Owner

Summary

  • Fix dedup race condition: The live-chat-discovery and live-chat-{dTag} subscriptions both receive kind 1311 events but only one copy passed the relay pool dedup check. When discovery won the race, the event went to trackChatter() (pill counts only) instead of addChatMessage() — silently dropping the message from chat. Registered "live-chat-" as a dedup bypass prefix so both subs independently reach EventRouter.
  • Fix ephemeral relay fragility: Chat relay connections were created with write=false and autoReconnect=false, meaning they couldn't survive transient drops during long streams. Now created with write=true, autoReconnect=true and released on cleanup.
  • Remove stale clearSeenEvents() call that was a workaround for the dedup issue and unnecessarily flushed the entire pool's seen-event cache.

Test plan

  • Open a live stream and verify chat messages from other clients appear in real time
  • Send a chat message and verify it appears on other Nostr clients (e.g. Amethyst, Coracle)
  • Stay in a stream for 5+ minutes and verify messages continue arriving (no silent disconnect)
  • Leave and re-enter a stream — verify chat loads correctly
  • Verify LiveNowRow pill chatter counts still update on the feed screen

Fix dedup race between live-chat-discovery and per-stream live-chat
subscriptions that silently dropped messages. Register "live-chat-" as
a dedup bypass prefix so both subs independently reach EventRouter.

Make ephemeral relay connections for live chat writable and
auto-reconnecting so streams survive transient connection drops.
@barrydeen barrydeen merged commit 40a86f7 into main Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant