From 1598cf0f0617fb87927ae0197ee5bdfca1e3b2a5 Mon Sep 17 00:00:00 2001 From: npub1tquskdu6yc4h8l7xxtceculxw600grekeq0xg2ukqfrwl7vrzg3quz3gmp <58390b379a262b73ffc632f19c73e6769ef40f36c81e642b960246eff9831222@buzz.block.builderlab.xyz> Date: Mon, 27 Jul 2026 20:02:16 -0700 Subject: [PATCH] fix(mobile): limit self-ignore to renderable push kinds Co-authored-by: npub1tquskdu6yc4h8l7xxtceculxw600grekeq0xg2ukqfrwl7vrzg3quz3gmp <58390b379a262b73ffc632f19c73e6769ef40f36c81e642b960246eff9831222@buzz.block.builderlab.xyz> Signed-off-by: npub1tquskdu6yc4h8l7xxtceculxw600grekeq0xg2ukqfrwl7vrzg3quz3gmp <58390b379a262b73ffc632f19c73e6769ef40f36c81e642b960246eff9831222@buzz.block.builderlab.xyz> --- mobile/ios/NotificationService/NotificationService.swift | 7 ++++--- mobile/lib/shared/push/push_subscription.dart | 2 +- .../test/shared/push/push_subscription_provider_test.dart | 2 ++ mobile/test/shared/push/push_subscription_test.dart | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/mobile/ios/NotificationService/NotificationService.swift b/mobile/ios/NotificationService/NotificationService.swift index df4380afb..a79328884 100644 --- a/mobile/ios/NotificationService/NotificationService.swift +++ b/mobile/ios/NotificationService/NotificationService.swift @@ -318,9 +318,10 @@ final class BuzzPushNotificationResolver: BuzzPushNotificationResolving { identity: identity ) } else { - // Wake-only kinds are fetched from the authoritative lease, but this - // extension cannot render them yet. The explicit result distinguishes - // that state from a catch-up network failure. + // This extension renders kind 9 only. Other lease-authorized wake kinds + // stay selectable so issue 10's catch-up sets remain aligned, but the + // user sees an explicit diagnostic instead of kind-aware content (issue + // 20) or a silent miss. resolution = BuzzPushResolution( title: "Buzz notification needs attention", body: "Buzz received a kind \(event.kind) wake that this app version cannot display.", diff --git a/mobile/lib/shared/push/push_subscription.dart b/mobile/lib/shared/push/push_subscription.dart index 3d71e57aa..6c4411053 100644 --- a/mobile/lib/shared/push/push_subscription.dart +++ b/mobile/lib/shared/push/push_subscription.dart @@ -282,7 +282,7 @@ List buildDesiredBuzzPushSubscriptions({ } final selfAuthored = BuzzPushFilter( - kinds: buzzPushEligibleKinds, + kinds: buzzPushRenderableKinds, authors: [normalizedPubkey], ); final ignores = [selfAuthored, ...mutedIgnoreFilters]; diff --git a/mobile/test/shared/push/push_subscription_provider_test.dart b/mobile/test/shared/push/push_subscription_provider_test.dart index f8865e5b4..27f0494d6 100644 --- a/mobile/test/shared/push/push_subscription_provider_test.dart +++ b/mobile/test/shared/push/push_subscription_provider_test.dart @@ -1,5 +1,6 @@ import 'package:buzz/features/channels/channel.dart'; import 'package:buzz/shared/community/community.dart'; +import 'package:buzz/shared/push/push_subscription.dart'; import 'package:buzz/shared/push/push_subscription_provider.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:nostr/nostr.dart' as nostr; @@ -31,6 +32,7 @@ void main() { expect(subscriptions, hasLength(1)); expect(subscriptions!.single.filter.pTags, hasLength(1)); expect(subscriptions.single.ignore, hasLength(2)); + expect(subscriptions.single.ignore.first.kinds, buzzPushRenderableKinds); expect(subscriptions.single.ignore.last.hTags, [activeID]); }, ); diff --git a/mobile/test/shared/push/push_subscription_test.dart b/mobile/test/shared/push/push_subscription_test.dart index ca8b5f452..8f4856fe1 100644 --- a/mobile/test/shared/push/push_subscription_test.dart +++ b/mobile/test/shared/push/push_subscription_test.dart @@ -56,6 +56,7 @@ void main() { expect(subscriptions.last.filter.kinds, buzzPushChannelKinds); expect(subscriptions.last.filter.hTags, [channelA]); expect(subscriptions.first.ignore, hasLength(2)); + expect(subscriptions.first.ignore.first.kinds, buzzPushRenderableKinds); expect(subscriptions.first.ignore.last.hTags, [channelB]); expect( subscriptions.first.suppress?.pTagsMax,