Skip to content

fix: let every relay save a group invitation before closing its pool - #196

Merged
TheCryptoDonkey merged 1 commit into
mainfrom
fix/publish-to-every-relay
Sep 27, 2026
Merged

TheCryptoDonkey merged 1 commit into
mainfrom
fix/publish-to-every-relay

Conversation

@TheCryptoDonkey

Copy link
Copy Markdown
Member

oathrun's per-room relay live test (oathrun #144 evidence) found a persistent group invitation (kind 1463) on only one of the room's relays; a lane moved to another relay failed to join, and they asked KithMoot to publish to every relay in the link.

Cause: NostrRelayPool.publish resolves at the first ack and keeps writing to slower relays in the background, but publishGroupInvitation and both invitation retirements closed their one-off pools immediately, aborting those writes.

  • NostrRelayPool.settled(timeoutMs = 20s): resolves when every in-flight publish has been answered by every relay, or at the deadline.
  • The three durable publishes close their pools after settled(), in the background, so room creation is no slower.

Tests: relay-pool unit tests (34, one new); persistent-groups.spec and e2e.spec pass on Chromium.

Follow-up in #194: when the maker shares relays for everyone, copy the group invitation to the added relays too.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CG4pPCsd8pdySNvBpt8fTk

A pool's publish resolves at the first relay's ack and keeps writing to
the others in the background, but the group invitation and invitation
retirements closed their one-off pools straight away, aborting those
writes. The durable event then sat on one relay: an agent host moved to
another of the room's relays could not join. Pools now close once every
relay has answered (`settled`, 20 s at most), in the background, so
creating a room is no slower.

Claude-Session: https://claude.ai/code/session_01CG4pPCsd8pdySNvBpt8fTk
@TheCryptoDonkey
TheCryptoDonkey merged commit 73e0ecb into main Sep 27, 2026
9 of 10 checks passed
@TheCryptoDonkey
TheCryptoDonkey deleted the fix/publish-to-every-relay branch September 28, 2026 02:10
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