Skip to content

Add notification preference handling for chat and group posts - #1005

Merged
tenkus47 merged 2 commits into
developfrom
notification-toggle
Sep 9, 2026
Merged

tenkus47 merged 2 commits into
developfrom
notification-toggle

Conversation

@tenkus47

@tenkus47 tenkus47 commented Sep 9, 2026

Copy link
Copy Markdown
Member
  • Integrated user notification preferences into chat and group post notification services, allowing for more granular control over notifications based on user settings.
  • Implemented functions to filter users by their notification preferences, ensuring that only eligible users receive notifications.
  • Updated relevant services and repositories to accommodate the new notification preference logic, enhancing the overall notification system.
  • Added tests to verify the correct behavior of the new notification preference features, ensuring robustness and reliability.

- Integrated user notification preferences into chat and group post notification services, allowing for more granular control over notifications based on user settings.
- Implemented functions to filter users by their notification preferences, ensuring that only eligible users receive notifications.
- Updated relevant services and repositories to accommodate the new notification preference logic, enhancing the overall notification system.
- Added tests to verify the correct behavior of the new notification preference features, ensuring robustness and reliability.
@greptile-apps

greptile-apps Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge.

Summary

  • Adds the preference schema, migration, API endpoints, models, repository, and service.
  • Applies preference filtering to chat, group-post, event, event-reminder, and series-reminder recipients.
  • Adds regression coverage for preference resolution, duplicate updates, and notification filtering.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Preference API] --> B[Preference service]
  B --> C[(User notification preferences)]
  D[Notification dispatch] --> E[Recipient query]
  C --> E
  E --> F[Eligible recipients]
  F --> G[Push delivery]
Loading

Comment thread pecha_api/notification/notification_preference_service.py Outdated
Comment on lines +68 to +71
NotificationType.EVENT,
NotificationType.EVENT_REMINDER,
NotificationType.ACCUMULATION,
NotificationType.SERIES,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Exposed toggles remain unenforced

When a user disables or mutes EVENT_REMINDER, ACCUMULATION, or SERIES, the API persists and returns that setting, but the corresponding dispatch paths never consult these preferences. Notifications of those types therefore continue to be delivered despite the reported setting.

Prompt To Fix With AI
This is a comment left during a code review.
Path: pecha_api/notification/notification_preference_enums.py
Line: 68-71

Comment:
**Exposed toggles remain unenforced**

When a user disables or mutes `EVENT_REMINDER`, `ACCUMULATION`, or `SERIES`, the API persists and returns that setting, but the corresponding dispatch paths never consult these preferences. Notifications of those types therefore continue to be delivered despite the reported setting.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

- Updated the `get_bookmarks_service` to drop bookmarks for items that no longer exist or are not visible to the user, improving the user experience by preventing dangling entries.
- Integrated notification preference filtering into event participant queries, ensuring that users only receive notifications they have opted into, particularly for event reminders and series notifications.
- Added tests to verify the correct behavior of the updated bookmark service and notification preference logic, ensuring robustness and reliability in handling user preferences.
@sonarqubecloud

sonarqubecloud Bot commented Sep 9, 2026

Copy link
Copy Markdown

@tenkus47
tenkus47 merged commit 664955b into develop Sep 9, 2026
8 checks passed
@tenkus47
tenkus47 deleted the notification-toggle branch September 9, 2026 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants