Skip to content

Full PostCard for reply notifications, NIP-05 impersonation detection, and reliability improvements#11

Merged
barrydeen merged 1 commit intomainfrom
feature/notification-reply-cards-and-improvements
Feb 19, 2026
Merged

Full PostCard for reply notifications, NIP-05 impersonation detection, and reliability improvements#11
barrydeen merged 1 commit intomainfrom
feature/notification-reply-cards-and-improvements

Conversation

@barrydeen
Copy link
Copy Markdown
Owner

Summary

  • Notification reply cards: Reply notifications now render as full PostCards (same as the feed), so users can react, zap, repost, quote, and bookmark replies directly from the notifications tab. A clickable "reply to #note1abc..." label links back to the original note being replied to.
  • NIP-05 impersonation detection: Distinguishes between server mismatch (impersonation — permanent red X) and network/parse errors (temporary — shows retry icon). Applies to PostCard and UserProfileScreen.
  • Relay reliability: Removes cooldowns from persistent relays to avoid cascading delays on app resume. Merges cached scored relays with pinned relays on init so the pool starts with the full relay set immediately after process restart.
  • Event deduplication: Adds dedup sets for reaction and zap counting to prevent double-counting when the seenEventIds LRU is trimmed and events are re-processed.
  • Quoted note improvements: Shows a loading spinner while fetching referenced notes, retries failed fetches after 30s instead of permanently blacklisting, and sends quote requests to all relays.
  • Feed lifecycle fix: Uses Activity lifecycle instead of NavBackStackEntry for resume detection, preventing duplicate re-subscriptions when switching tabs.

Changed files

File Change
NotificationsScreen.kt Replace inline reply rendering with full PostCard; add "reply to" label; collect version flows for live stats
Navigation.kt Wire up zap dialog, bookmark state, and all action callbacks for notification reply cards
NotificationsViewModel.kt Expose contactRepository getter
PostCard.kt Add showDivider param; NIP-05 impersonation vs error handling with retry icon
Nip05.kt New Nip05Result enum (VERIFIED/MISMATCH/ERROR) replacing boolean return
Nip05Repository.kt New IMPERSONATOR and ERROR statuses; retry() method; identifier caching
UserProfileScreen.kt NIP-05 impersonation detection and retry icon
RelayPool.kt Cooldowns only for ephemeral relays
RelayScoreBoard.kt Rebuild scored relays from persisted data on init
FeedViewModel.kt Merge cached scored relays with pinned on init
EventRepository.kt Reaction/zap dedup sets to prevent double-counting
MetadataFetcher.kt Retry failed quotes after 30s; send to all relays; evict by age
RichContent.kt Loading spinner for unfetched quoted notes
FeedScreen.kt Activity lifecycle for resume detection

Test plan

  • Open notifications tab and verify reply notifications render as full note cards with action bar
  • React/zap/repost a reply directly from notifications and confirm counts update
  • Tap "reply to #note1abc..." label and verify navigation to the original note thread
  • Verify NIP-05 verified users show orange checkmark, impersonators show red X, errors show retry icon
  • Kill and restart app, verify relays reconnect quickly without long cooldown delays
  • Verify reaction/zap counts remain accurate after extended use (no double-counting)
  • Verify quoted notes show loading spinner then resolve correctly

…, and reliability improvements

Notifications:
- Replace inline reply rendering with full PostCard in notifications tab,
  enabling reactions, zaps, reposts, quotes, and bookmarks directly from
  notifications
- Add clickable "reply to #note1abc..." label linking to the original note
- Wire up zap dialog, bookmark state, and all action callbacks in Navigation

NIP-05 verification:
- Distinguish IMPERSONATOR (server returned different pubkey) from ERROR
  (network/parse failure) with separate Nip05Result enum
- Show retry icon on ERROR status in PostCard and UserProfileScreen
- Mark impersonation with red X, keep errors retryable

Relay reliability:
- Remove cooldowns from persistent relays — only apply to ephemeral relays,
  avoiding cascading delays on app resume
- Merge cached scored relays with pinned relays on init for immediate full
  relay set on process restart
- Rebuild scored relays from persisted data in RelayScoreBoard init

Event deduplication:
- Add countedReactionIds/countedZapIds sets to prevent double-counting when
  seenEventIds LRU is trimmed and events are re-processed

Quoted notes:
- Show loading spinner instead of static text while fetching referenced notes
- Retry failed quote fetches after 30s instead of permanently blacklisting
- Send quote requests to all relays instead of just read relays

Feed lifecycle:
- Use Activity lifecycle instead of NavBackStackEntry for resume detection,
  preventing duplicate re-subscriptions on tab navigation
@barrydeen barrydeen merged commit 6c17cdd into main Feb 19, 2026
@barrydeen barrydeen deleted the feature/notification-reply-cards-and-improvements 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