From 173a422d8642b611db9846c47ef8fc0d70170ea2 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 26 Jun 2026 13:00:39 +0000 Subject: [PATCH] fix: notify on NIP-34 pull requests (kind 1618/1619) New pull request events (GitPullRequestEvent, kind 1618) and pull request updates (GitPullRequestUpdateEvent, kind 1619) were never wired into the notification pipeline, which only handled patches (1617) and issues (1621). As a result repo maintainers received no notification when a PR was opened against their repository, even though the PR event p-tags the repo owner. Add both kinds in all four places that gate notifications: - FilterNotificationsToPubkey: request the kinds from relays so the notification subscription actually pulls PR events. - NotificationFeedFilter.NOTIFICATION_KINDS: let cached PR events through to the in-app Notifications tab. - NotificationFeedFilter.tagsAnEventByUser: treat PR/PR-update as notifiable (mirrors the existing patch/issue handling). - EventNotificationConsumer: dispatch PR/PR-update via notifyMention so push notifications fire. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_018wCXL6btUeZZmSP1TCYkKh --- .../service/notifications/EventNotificationConsumer.kt | 4 ++++ .../nip01Notifications/FilterNotificationsToPubkey.kt | 4 ++++ .../loggedIn/notifications/dal/NotificationFeedFilter.kt | 8 +++++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/notifications/EventNotificationConsumer.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/notifications/EventNotificationConsumer.kt index 2a1ea4887c..8b048326b9 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/notifications/EventNotificationConsumer.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/notifications/EventNotificationConsumer.kt @@ -72,6 +72,8 @@ import com.vitorpamplona.quartz.nip28PublicChat.message.ChannelMessageEvent import com.vitorpamplona.quartz.nip30CustomEmoji.CustomEmoji import com.vitorpamplona.quartz.nip34Git.issue.GitIssueEvent import com.vitorpamplona.quartz.nip34Git.patch.GitPatchEvent +import com.vitorpamplona.quartz.nip34Git.pr.GitPullRequestEvent +import com.vitorpamplona.quartz.nip34Git.pr.GitPullRequestUpdateEvent import com.vitorpamplona.quartz.nip54Wiki.WikiNoteEvent import com.vitorpamplona.quartz.nip57Zaps.LnZapEvent import com.vitorpamplona.quartz.nip57Zaps.LnZapRequestEvent @@ -268,6 +270,8 @@ class EventNotificationConsumer( is PollEvent, is GitPatchEvent, is GitIssueEvent, + is GitPullRequestEvent, + is GitPullRequestUpdateEvent, is HighlightEvent, is LongTextNoteEvent, is WikiNoteEvent, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/reqCommand/account/nip01Notifications/FilterNotificationsToPubkey.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/reqCommand/account/nip01Notifications/FilterNotificationsToPubkey.kt index 10cca27dc1..aeef3e5da1 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/reqCommand/account/nip01Notifications/FilterNotificationsToPubkey.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/reqCommand/account/nip01Notifications/FilterNotificationsToPubkey.kt @@ -40,6 +40,8 @@ import com.vitorpamplona.quartz.nip25Reactions.ReactionEvent import com.vitorpamplona.quartz.nip28PublicChat.message.ChannelMessageEvent import com.vitorpamplona.quartz.nip34Git.issue.GitIssueEvent import com.vitorpamplona.quartz.nip34Git.patch.GitPatchEvent +import com.vitorpamplona.quartz.nip34Git.pr.GitPullRequestEvent +import com.vitorpamplona.quartz.nip34Git.pr.GitPullRequestUpdateEvent import com.vitorpamplona.quartz.nip34Git.reply.GitReplyEvent import com.vitorpamplona.quartz.nip47WalletConnect.events.LnZapPaymentResponseEvent import com.vitorpamplona.quartz.nip52Calendar.appt.day.CalendarDateSlotEvent @@ -84,6 +86,8 @@ val NotificationsPerKeyKinds2 = GitReplyEvent.KIND, GitIssueEvent.KIND, GitPatchEvent.KIND, + GitPullRequestEvent.KIND, + GitPullRequestUpdateEvent.KIND, HighlightEvent.KIND, CommentEvent.KIND, CalendarDateSlotEvent.KIND, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/notifications/dal/NotificationFeedFilter.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/notifications/dal/NotificationFeedFilter.kt index 5e2d20ddd8..9840680ee9 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/notifications/dal/NotificationFeedFilter.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/notifications/dal/NotificationFeedFilter.kt @@ -54,6 +54,8 @@ import com.vitorpamplona.quartz.nip25Reactions.ReactionEvent import com.vitorpamplona.quartz.nip28PublicChat.message.ChannelMessageEvent import com.vitorpamplona.quartz.nip34Git.issue.GitIssueEvent import com.vitorpamplona.quartz.nip34Git.patch.GitPatchEvent +import com.vitorpamplona.quartz.nip34Git.pr.GitPullRequestEvent +import com.vitorpamplona.quartz.nip34Git.pr.GitPullRequestUpdateEvent import com.vitorpamplona.quartz.nip52Calendar.appt.day.CalendarDateSlotEvent import com.vitorpamplona.quartz.nip52Calendar.appt.time.CalendarTimeSlotEvent import com.vitorpamplona.quartz.nip52Calendar.rsvp.CalendarRSVPEvent @@ -128,6 +130,8 @@ class NotificationFeedFilter( GenericRepostEvent.KIND, GitIssueEvent.KIND, GitPatchEvent.KIND, + GitPullRequestEvent.KIND, + GitPullRequestUpdateEvent.KIND, HighlightEvent.KIND, TextNoteEvent.KIND, ReactionEvent.KIND, @@ -205,7 +209,9 @@ class NotificationFeedFilter( return true } - if (event is GitIssueEvent || event is GitPatchEvent) { + if (event is GitIssueEvent || event is GitPatchEvent || + event is GitPullRequestEvent || event is GitPullRequestUpdateEvent + ) { return true }