Skip to content

feat: default DM relays with race condition fix#194

Merged
barrydeen merged 1 commit intomainfrom
feat/default-dm-relays
Mar 10, 2026
Merged

feat: default DM relays with race condition fix#194
barrydeen merged 1 commit intomainfrom
feat/default-dm-relays

Conversation

@barrydeen
Copy link
Copy Markdown
Owner

Summary

  • Apply a default DM relay (wss://auth.nostr1.com) for users who have no DM relays configured, and broadcast the relay list to indexers
  • Add private zaps with DM relay routing and a zap inspector in reaction details
  • Fix race condition where the app would overwrite existing DM relay lists with defaults because kind 10050 events were still being processed async by EventRouter after EOSE — now reactively waits on dmRelaysFlow and queries write relays (outbox) as a second source before concluding the user has none

Test plan

  • Login with an account that has existing DM relays — verify they are preserved and not overwritten
  • Login with an account that has no DM relays — verify wss://auth.nostr1.com is applied as default
  • Check logs for DM relays arrived during wait vs Applied default DM relays to confirm correct detection
  • Test private zaps flow end-to-end
  • Verify zap inspector shows correct details in reaction sheet

The previous implementation checked keyRepo.getDmRelays() synchronously
after EOSE, but kind 10050 events were still being processed async by
EventRouter. This caused false negatives that overwrote existing DM
relay lists with defaults.

Now reactively waits on dmRelaysFlow and also queries write relays
(outbox) as a second source before concluding the user has no DM relays.
@barrydeen barrydeen merged commit 098da1d into main Mar 10, 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