Artemis icon indicating copy to clipboard operation
Artemis copied to clipboard

`Development`: Fix broken push notifications for mobile apps

Open TimOrtel opened this issue 1 year ago • 1 comments

Checklist

General

Server

  • [x] Important: I implemented the changes with a very good performance and prevented too many (unnecessary) database calls.
  • [x] I strictly followed the server coding and design guidelines.
  • [x] I documented the Java code using JavaDoc style.

Motivation and Context

Recent changes to the notification component broke the push notifications for Android and iOS devices. In order to prepare for the upcoming release of the Android app, we should fix these asap so we can start testing.

Description

Readded conversation name to reply notification

Steps for Testing

  1. Install the Android App on your Android Emulator
  2. Register for push notifications in the Android App
  3. Send yourself some notifications from the web client

Testserver States

[!NOTE] These badges show the state of the test servers. Green = Currently available, Red = Currently locked

Review Progress

Code Review

  • [x] Code Review 1
  • [x] Code Review 2

Manual Tests

  • [x] Test 1
  • [x] Test 2

Summary by CodeRabbit

  • New Features
    • Added new constructors, fields, and methods to enhance conversation functionality.
  • Bug Fixes
    • Improved data handling and processing for conversations and messages.
  • Refactor
    • Updated the way conversationName is retrieved in ConversationNotificationService.

TimOrtel avatar Feb 08 '24 17:02 TimOrtel

Walkthrough

The set of changes focuses on enhancing the conversation and messaging functionalities within a software system. Modifications include improving the readability of conversation names for users, optimizing data loading for conversation participants, refining the message creation process within conversations, and ensuring clean handling of conversation participants during message logging. These updates aim to streamline user notifications, data access efficiency, and message management, contributing to a more effective and user-friendly communication feature.

Changes

File Path Change Summary
.../notification/SingleUserNotificationFactory.java
.../domain/metis/conversation/Channel.java
.../domain/metis/conversation/Conversation.java
.../domain/metis/conversation/GroupChat.java
.../domain/metis/conversation/OneToOneChat.java
Updates related to conversation handling, including readability improvements, new constructors, abstract methods, copy functionality, and additional parameterized constructors.
.../repository/metis/conversation/ConversationRepository.java Added Optional and EntityGraph imports, and introduced a new method findWithParticipantsById with an EntityGraph annotation for eager loading of conversation participants.
.../service/metis/ConversationMessagingService.java Adjustments to message creation within conversations, including changes in how conversations are retrieved and processed, focusing on data sent to clients and payload management in responses.
.../web/rest/metis/ConversationMessageResource.java Imported java.util.Collections and modified message creation to handle conversation participants as an empty set before logging.

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>.
    • Generate unit-tests for this file.
  • 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 tests 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 generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

coderabbitai[bot] avatar Feb 08 '24 17:02 coderabbitai[bot]