Skip to content

fix: repost notifications and subscription lifecycle on reconnect#31

Merged
barrydeen merged 1 commit intomainfrom
fix/subscription-lifecycle-and-repost-notifications
Feb 22, 2026
Merged

fix: repost notifications and subscription lifecycle on reconnect#31
barrydeen merged 1 commit intomainfrom
fix/subscription-lifecycle-and-repost-notifications

Conversation

@barrydeen
Copy link
Copy Markdown
Owner

Summary

Fix missing repost notifications and subscription drops on reconnect/resume.

Changes

1. Repost notifications (kind 6)

  • Notification filter now includes kind 6 (was only 1, 7, 9735)
  • New RepostNotification type in NotificationGroup sealed class
  • NotificationRepository.addEvent() handles kind 6 → mergeRepost()
  • processRelayEvent() routes kind 6 through eventRepo.addEvent()
  • NotificationsScreen renders repost notifications with "{name} reposted" header + referenced PostCard
  • purgeUser() and getAllPostCardEventIds() updated for new type

2. Engagement re-subscribe on soft resume

  • resumeSubscribeFeed() now calls subscribeEngagementForFeed() after EOSE
  • Previously, soft reconnect re-subscribed the feed but left engagement subs stale — reactions/zaps/reply counts stopped updating

3. Notification engagement restored on feed refresh

  • resubscribeFeed() clears ALL engagement subs (including notification engagement) but only re-subscribed feed engagement
  • Now also calls subscribeNotifEngagement() after EOSE so notification reaction/zap data stays live

4. DM/notification subs restored on force reconnect

  • Extracted subscribeDmsAndNotifications() from subscribeSelfData()
  • onReconnected(force=true) now calls it — previously forceReconnectAll() tore down all subscriptions but only feed was re-subscribed, leaving DMs and notifications dead

Testing

  • Verify repost notifications appear in notification tab
  • Long-press home → return to app → verify engagement data (reactions, zaps, reply counts) still updates
  • Pull-to-refresh feed → verify notification engagement still works
  • Leave app backgrounded for >30s → return → verify DMs and notifications resume

Four fixes:

1. Repost notifications (kind 6):
   - Add kind 6 to notification filter
   - New RepostNotification type in NotificationGroup
   - Handle kind 6 in NotificationRepository.addEvent()
   - Render repost notifications in NotificationsScreen
   - Include in purgeUser and getAllPostCardEventIds

2. Engagement re-subscribe on soft resume:
   - resumeSubscribeFeed() now calls subscribeEngagementForFeed()
     after EOSE so engagement data refreshes on app resume

3. Notification engagement restored on feed refresh:
   - resubscribeFeed() was clearing all engagement subs but only
     re-subscribing feed engagement. Now also calls
     subscribeNotifEngagement() after EOSE.

4. DM/notification subs restored on force reconnect:
   - Extract subscribeDmsAndNotifications() from subscribeSelfData()
   - Call it from onReconnected when force=true (forceReconnectAll
     tears down all active subscriptions)
@barrydeen barrydeen merged commit 7a63209 into main Feb 22, 2026
@barrydeen barrydeen deleted the fix/subscription-lifecycle-and-repost-notifications 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