Skip to content

fix: deduplicate replaceable events on profile screen#50

Merged
barrydeen merged 1 commit intomainfrom
fix/profile-follow-count-flash
Feb 26, 2026
Merged

fix: deduplicate replaceable events on profile screen#50
barrydeen merged 1 commit intomainfrom
fix/profile-follow-count-flash

Conversation

@barrydeen
Copy link
Copy Markdown
Owner

Summary

  • Add created_at timestamp guards for kind 0 (profile), kind 3 (follow list), and kind 10002 (relay list) events in UserProfileViewModel
  • Only the newest version of each replaceable event is applied, preventing stale copies from different relays from overwriting newer data
  • Fixes follow count flashing between two numbers when viewing a profile

Test plan

  • Navigate to own profile — follow count should settle on one number without flashing
  • Navigate to a followed user's profile — same stable behavior
  • Log out, log back in with nsec, navigate to profile — stable follow count on cold start

Guard kind 0, 3, and 10002 event handlers in UserProfileViewModel with
created_at timestamp checks so only the newest version from any relay is
used. Prevents follow count, profile data, and relay list from flashing
between values when multiple relays return different copies.
@barrydeen barrydeen merged commit bf87a2a into main Feb 26, 2026
@barrydeen barrydeen deleted the fix/profile-follow-count-flash branch March 4, 2026 01:29
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