From 19bbfb3be4ad3819450e1bcc477e32338ddc9276 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 13 Jul 2026 23:37:27 +0000 Subject: [PATCH] fix: keep kind:1059 gift wraps out of the Android notifications tab MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The desktop notifications redesign (ecedc4af) extracted the shared NotificationKinds.SUBSCRIPTION_KINDS list from Android's NotificationFeedFilter and rewired NOTIFICATION_KINDS to spread it. The shared list includes GiftWrapEvent.KIND (1059) because it doubles as the relay subscription filter (you must ask relays for wraps to receive NIP-17 DMs) and because Desktop renders the wrap itself as a DM inbox row. Android's display list never had 1059 before that commit, so the delegation silently started rendering wrap envelopes in the Notifications tab — with created_at randomized up to 2 days back per NIP-59, producing misordered, undecryptable rows instead of routing DMs to the chat screens. Subtract GiftWrapEvent.KIND from the Android display set, restoring the pre-extraction behavior (1059 was the only kind the delegation added). SUBSCRIPTION_KINDS keeps 1059, so the desktop relay subscription, the desktop OS-toast allow-list, and the desktop inbox DM rows are all unaffected. Android push is likewise untouched: NotificationDispatcher already excludes 1059/21059/13 and notifies on the unwrapped inner event. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_011A6iSrJJHUoz686eDnCQMV --- .../notifications/dal/NotificationFeedFilter.kt | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) 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 f10921bd06..f75d0f8c3e 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 @@ -64,6 +64,7 @@ import com.vitorpamplona.quartz.nip53LiveActivities.streaming.LiveActivitiesEven import com.vitorpamplona.quartz.nip54Wiki.WikiNoteEvent import com.vitorpamplona.quartz.nip57Zaps.LnZapEvent import com.vitorpamplona.quartz.nip58Badges.award.BadgeAwardEvent +import com.vitorpamplona.quartz.nip59Giftwrap.wraps.GiftWrapEvent import com.vitorpamplona.quartz.nip64Chess.challenge.accept.LiveChessGameAcceptEvent import com.vitorpamplona.quartz.nip64Chess.move.LiveChessMoveEvent import com.vitorpamplona.quartz.nip68Picture.PictureEvent @@ -126,9 +127,18 @@ class NotificationFeedFilter( // highlights, polls, videos, voice, public messages, // live-activities chat) stay here because Desktop has no // rendering for those kinds today. - com.vitorpamplona.amethyst.commons.moderation.notifications.NotificationKinds - .SUBSCRIPTION_KINDS - .toSet() + + // + // GiftWrap (1059) is subscription-only: the wrap is an envelope whose + // created_at is randomized up to 2 days back (NIP-59), so rendering it + // as a feed row would misorder the tab with undecryptable entries. On + // Android the unwrapped inner event (kind 14/15/…) is what notifies — + // same rule NotificationDispatcher applies to push. Desktop keeps the + // wrap in its inbox because it has no unwrap pipeline there yet. + ( + com.vitorpamplona.amethyst.commons.moderation.notifications.NotificationKinds + .SUBSCRIPTION_KINDS + .toSet() - GiftWrapEvent.KIND + ) + setOf( BadgeAwardEvent.KIND, GitIssueEvent.KIND,