Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Communication: Fix push notifications for user mentions #10418

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

FelberMartin
Copy link
Contributor

@FelberMartin FelberMartin commented Feb 27, 2025

Checklist

General

Server

Motivation and Context

There are two issues regarding push notifications (sent to iOS/Android) for user mentions:

  1. Users are notified about mentions in (public and private) channels that they are not part of, even though they should not be notified.
  2. Users are not notified about being mentioned in a reply to a thread they are not part of, even though they should be notified.

This PR closes #10368

Description

  • Fix (1.) by removing code that added all mentioned users, regardless of their conversation membership
  • Fix (2.) by adding notification type CONVERSATION_USER_MENTION to instant-notifications enabled types
  • Updated the user documentation about available notification types, by replacing the previous screenshots of an excel table with a easily editable .rst table. This enables the developers to keep the documentation always up-to-date with little effort

Steps for Testing

Prerequisites:

  • 2 Students
    • 1 Logged in the webapp
    • 1 Logged in the Android or iOS mobile app with notifications enabled

Note: When testing with Android, you need the latest version of the artemis-android develop branch

Issue 1:

  1. Webapp: Create a public or private channel without adding anyone
  2. Webapp: Send a message to the channel with a mention for mobile user
  3. Mobile: Observe that no push notification is received

Issue 2:

  1. Webapp: Create a message in any channel
  2. Webapp: Reply to it with a mention for the mobile user
  3. Mobile: Observe that a push notification about the mention is received

Documentation update:
Check out the updated notification table

Testserver States

You can manage test servers using Helios. Check environment statuses in the environment list. To deploy to a test server, go to the CI/CD page, find your PR or branch, and trigger the deployment.

Review Progress

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Summary by CodeRabbit

  • Documentation

    • Revamped the notifications guide with a structured table that clearly categorizes supported notification types and highlights their availability across channels.
  • New Features

    • Enhanced instant notification support by including user mention notifications alongside existing types.
    • Refined conversation notification behavior for more accurate delivery, ensuring users receive alerts only when relevant (for instance, when they are directly mentioned).

@FelberMartin FelberMartin self-assigned this Feb 27, 2025
@FelberMartin FelberMartin requested a review from a team as a code owner February 27, 2025 14:14
@github-actions github-actions bot added server Pull requests that update Java code. (Added Automatically!) documentation communication Pull requests that affect the corresponding module labels Feb 27, 2025
@FelberMartin FelberMartin added ready for review bugfix documentation communication Pull requests that affect the corresponding module and removed documentation communication Pull requests that affect the corresponding module labels Feb 27, 2025
coderabbitai[bot]
coderabbitai bot previously approved these changes Feb 27, 2025
@ls1intum ls1intum deleted a comment from coderabbitai bot Feb 27, 2025
…ns-for-user-mentions

# Conflicts:
#	src/main/java/de/tum/cit/aet/artemis/communication/service/notifications/NotificationSettingsService.java
@ls1intum ls1intum deleted a comment from coderabbitai bot Feb 27, 2025
@helios-aet helios-aet bot temporarily deployed to artemis-test2.artemis.cit.tum.de February 27, 2025 14:43 Inactive
@FelberMartin FelberMartin reopened this Feb 28, 2025
Copy link

coderabbitai bot commented Feb 28, 2025

Walkthrough

This pull request restructures the notification documentation and refines notification handling in the notification services. The documentation now presents supported notification types in a list-table format rather than via images. In the Java code, the logic for determining notification recipients is changed in the conversation messaging service by removing automatic inclusion of all mentioned users and updating the author inclusion conditions. Additionally, the set for instant notification support in the notification settings service is updated to replace one notification type with another.

Changes

File(s) Change Summary
docs/user/notifications.rst Restructured the supported notification types section: replaced the image-based overview with a comprehensive list-table organized by categories, and removed image references. A note now directs users to the NotificationPlaceholderCreator interface for further details.
src/main/java/.../ConversationMessagingService.java
src/main/java/.../notifications/NotificationSettingsService.java
In ConversationMessagingService, removed the line that auto-included mentioned users and refined the filtering logic to consider author self-mentions. In NotificationSettingsService, updated the instant notification types set by retaining NEW_REPLY_FOR_EXERCISE_POST and adding CONVERSATION_USER_MENTIONED.

Suggested labels

tests, small

Suggested reviewers

  • PaRangger
  • sachmii
  • HawKhiem
  • krusche

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4da6460 and 21b29ae.

📒 Files selected for processing (1)
  • src/main/java/de/tum/cit/aet/artemis/communication/service/notifications/NotificationSettingsService.java (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/java/de/tum/cit/aet/artemis/communication/service/notifications/NotificationSettingsService.java
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: Call Build Workflow / Build .war artifact
  • GitHub Check: Call Build Workflow / Build and Push Docker Image
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: client-style
  • GitHub Check: client-tests
  • GitHub Check: server-style
  • GitHub Check: server-tests
  • GitHub Check: Analyse

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot]
coderabbitai bot previously approved these changes Feb 28, 2025
@helios-aet helios-aet bot temporarily deployed to artemis-test2.artemis.cit.tum.de March 1, 2025 15:17 Inactive
Copy link
Member

@anian03 anian03 left a comment

Choose a reason for hiding this comment

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

Tested on TS2 with Artemis iOS 1.6.2 via Xcode, notifications for mentions now work as expected. Thanks for fixing it!

@helios-aet helios-aet bot temporarily deployed to artemis-test7.artemis.cit.tum.de March 1, 2025 22:20 Inactive
@helios-aet helios-aet bot temporarily deployed to artemis-test5.artemis.cit.tum.de March 8, 2025 18:38 Inactive
Copy link
Contributor

@PaRangger PaRangger left a comment

Choose a reason for hiding this comment

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

Tested on TS5, works as described. 👍

@krusche krusche modified the milestones: 7.10.5, 7.10.6 Mar 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix communication Pull requests that affect the corresponding module documentation ready for review server Pull requests that update Java code. (Added Automatically!)
Projects
Status: Work In Progress
Status: In Progress
Development

Successfully merging this pull request may close these issues.

Communication: Push notifications for mentions not working as expected
4 participants