Skip to content

Fix feed showing incomplete notes on startup#24

Merged
barrydeen merged 1 commit intomainfrom
fix/feed-startup-outbox-routing
Feb 21, 2026
Merged

Fix feed showing incomplete notes on startup#24
barrydeen merged 1 commit intomainfrom
fix/feed-startup-outbox-routing

Conversation

@barrydeen
Copy link
Copy Markdown
Owner

Summary

  • Fix feed subscribing before the relay scoreboard is fully populated, causing outbox routing to fall back to broadcasting and showing sparse/inconsistent notes
  • Persist the full relay scoreboard to SharedPreferences so subsequent app launches skip the expensive relay-list fetch when the follow list hasn't changed
  • Add incremental scoreboard updates when following/unfollowing users mid-session (no full recompute needed)
  • Add init loading overlay with animated progress bar showing each startup step
  • Improve OutboxRouter to look up write relays directly for uncovered authors instead of broadcasting

Test plan

  • Fresh install: loading overlay shows progress through all steps, feed loads with full notes
  • Subsequent launch (same follow list): feed loads near-instantly using cached scoreboard
  • Follow a new user from profile → their notes appear in feed without full reload
  • Unfollow a user → their notes stop appearing
  • Pull-to-refresh: rebuilds scoreboard and shows current notes
  • Check relay tab: all relays should show correct npub counts immediately after load
  • Extended follows feed still works correctly

The feed was subscribing before the relay scoreboard was fully built,
causing outbox routing to fall back to broadcasting and producing
sparse, inconsistent results.

Changes:

- Make init and refresh flows sequential: connect → self-data → fetch
  relay lists → wait for 90% coverage → recompute scoreboard → subscribe
  feed. The feed no longer fires until routing is ready.

- Persist the full relay scoreboard (author→relay map + follow set) to
  SharedPreferences. On subsequent launches, if the follow list hasn't
  changed, skip the relay-list fetch entirely and subscribe immediately
  using the cached scoreboard.

- Add incremental scoreboard updates: following a new user inserts them
  into the smallest matching relay (promoting decentralization);
  unfollowing removes them. No full recompute needed mid-session.

- Add init loading overlay with progress bar showing each startup step
  (connecting, found follows, fetching relay lists, computing routing,
  subscribing) so the user sees what's happening during first load.

- Improve OutboxRouter to look up write relays directly for authors not
  covered by the scoreboard, instead of dumping them all into a single
  sendToAll broadcast.

- Remove resetSeenEvents() from EventRepository (no longer needed).
@barrydeen barrydeen merged commit 459fc95 into main Feb 21, 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