Skip to content

fix: filter repost notifications to only the user's own posts#52

Merged
barrydeen merged 1 commit intomainfrom
fix/repost-notification-spam
Feb 26, 2026
Merged

fix: filter repost notifications to only the user's own posts#52
barrydeen merged 1 commit intomainfrom
fix/repost-notification-spam

Conversation

@barrydeen
Copy link
Copy Markdown
Owner

Summary

  • Engagement subscriptions added kind 6 filters (from fix: fetch and display repost counts on profile screen #51), but EventRouter routed all repost events to NotificationRepository without verifying the reposted event belongs to the current user — causing everyone's reposts to appear as notifications
  • Add ownership check in EventRouter: only route kind 6 events to notifications when the reposted event is authored by the current user
  • Add missing 6 -> eventRepo.addEvent(event) in the engagement handler so repost counts are actually tracked from engagement subscriptions

Test plan

  • Open the app and browse the feed
  • Verify notifications only show reposts of your own posts, not others'
  • Visit a profile and confirm repost counts still display correctly
  • Repost someone's post and verify it doesn't generate a self-notification

Engagement subscriptions now fetch kind 6 (repost) events for all
viewed posts, but EventRouter was routing all of them to
NotificationRepository without checking ownership. This caused
every repost on the feed to appear as a notification.

Add an ownership check in EventRouter so only reposts of the user's
own events are forwarded to notifications. Also add the missing
kind 6 handler in the engagement branch so repost counts are tracked.
@barrydeen barrydeen merged commit 3379523 into main Feb 26, 2026
@barrydeen barrydeen deleted the fix/repost-notification-spam 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