mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
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>
This commit is contained in:
parent
2da2da5ab8
commit
1598cf0f06
@@ -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.",
|
||||
|
||||
@@ -282,7 +282,7 @@ List<BuzzPushSubscription> buildDesiredBuzzPushSubscriptions({
|
||||
}
|
||||
|
||||
final selfAuthored = BuzzPushFilter(
|
||||
kinds: buzzPushEligibleKinds,
|
||||
kinds: buzzPushRenderableKinds,
|
||||
authors: [normalizedPubkey],
|
||||
);
|
||||
final ignores = [selfAuthored, ...mutedIgnoreFilters];
|
||||
|
||||
@@ -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]);
|
||||
},
|
||||
);
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user