Skip to content

Smart relay selection for list feeds#38

Merged
barrydeen merged 1 commit intomainfrom
feat/smart-relay-selection-list-feeds
Feb 26, 2026
Merged

Smart relay selection for list feeds#38
barrydeen merged 1 commit intomainfrom
feat/smart-relay-selection-list-feeds

Conversation

@barrydeen
Copy link
Copy Markdown
Owner

Summary

  • Pre-fetch kind 10002 relay lists and profiles for list members before subscribing to their notes, so subscribeByAuthors can route to their actual write relays instead of falling back to pinned relays only
  • Wait for multiple EOSEs on prefetch (not single) with dedicated sub IDs to avoid race conditions with startup and fast empty relays
  • Widen list feed time window from 24h to 7 days for better coverage of infrequent posters
  • Add top-5 scored relays as safety net for engagement queries (reactions, zaps, replies)

Test plan

  • Create a list with 5-10 npubs NOT in the follow list
  • Select the list as feed — verify notes appear from all/most authors
  • Check engagement stats (reactions, reposts, zaps) load for the notes
  • Switch away from list feed and back — verify consistent results
  • Verify follows feed is unaffected (still 24h window)
  • Check logcat [FeedSub] logs for prefetch → feed subscribe flow

Pre-fetch kind 10002 relay lists and profiles for list members before
subscribing to their notes. Without this, authors not in the follow list
had no cached relay data, causing subscribeByAuthors to route them to
fallback pinned relays only — missing most of their content.

- Pre-fetch relay lists + profiles with multi-EOSE await (not single)
  to avoid proceeding on the first empty relay's EOSE
- Use dedicated sub IDs (list-prefetch, list-prefetch-more) to avoid
  collisions with startup's relay-lists subscription
- Track prefetch coroutine in feedEoseJob for proper cancellation
- Widen list feed time window to 7 days (vs 24h for follows)
- Add safety-net relays to engagement queries using top scored relays
- Remove redundant fire-and-forget relay list fetch from setSelectedList
@barrydeen barrydeen merged commit 97931b8 into main Feb 26, 2026
@barrydeen barrydeen deleted the feat/smart-relay-selection-list-feeds branch March 4, 2026 01:28
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