fix: let every relay save a group invitation before closing its pool - #196
Merged
Merged
Conversation
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
This was referenced Sep 27, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.publishresolves at the first ack and keeps writing to slower relays in the background, butpublishGroupInvitationand 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.settled(), in the background, so room creation is no slower.Tests: relay-pool unit tests (34, one new);
persistent-groups.specande2e.specpass 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