Skip to content

Commit 7f42386

Browse files
committed
refactor(notifications): update breaking news subscription query
Updates the `sendBreakingNewsNotification` method in `DefaultPushNotificationService` to query `user_content_preferences` using the new `savedHeadlineFilters.deliveryTypes` field. This aligns the notification subscription logic with the updated `UserContentPreferences` model, replacing the deprecated `interests` field.
1 parent 0378a35 commit 7f42386

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/src/services/push_notification_service.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,12 @@ class DefaultPushNotificationService implements IPushNotificationService {
117117
return;
118118
}
119119

120-
// 2. Find all user preferences that contain an interest subscribed to
121-
// breaking news. This query targets the embedded 'interests' array.
120+
// 2. Find all user preferences that contain a saved headline filter
121+
// subscribed to breaking news. This query targets the embedded 'savedHeadlineFilters' array.
122122
final subscribedUserPreferences = await _userContentPreferencesRepository
123123
.readAll(
124124
filter: {
125-
'interests.deliveryTypes': {
125+
'savedHeadlineFilters.deliveryTypes': {
126126
r'$in': [
127127
PushNotificationSubscriptionDeliveryType.breakingOnly.name,
128128
],

0 commit comments

Comments
 (0)