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

Communications: Fix A Bug That Prevented to Answer Threads in Group Chats #8851

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

Conversation

egekurt123
Copy link
Contributor

@egekurt123 egekurt123 commented Jun 22, 2024

Checklist

General

Server

  • Important: I implemented the changes with a very good performance and prevented too many (unnecessary) database calls.
  • I strictly followed the server coding and design guidelines.
  • I added pre-authorization annotations according to the guidelines and checked the course groups for all new REST Calls (security).
  • I documented the Java code using JavaDoc style.

Motivation and Context

This PR addresses and resolves an issue that was preventing users from replying to group chat threads.

Description

Lazy fetch types for was causing getConversations() and getPosts() methods to raise an exception, so they were changed to Eager fetch types

Steps for Testing

Prerequisites:

  • 1 Instructor / Student
  • 1 Course with Messaging enabled
  1. Log in to Artemis
  2. Navigate to a Course with Messaging enabled
  3. Create a group chat
  4. Write a message to the group chat
  5. Reply to the message
  6. Make sure that there is no internal error

Testserver States

Note

These badges show the state of the test servers.
Green = Currently available, Red = Currently locked
Click on the badges to get to the test servers.







Review Progress

Performance Review

  • I (as a reviewer) confirm that the server changes (in particular related to database calls) are implemented with a very good performance

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Summary by CodeRabbit

  • New Features

    • Improved group chat naming to generate human-readable names based on participant names.
  • Refactor

    • Simplified logic for retrieving the group's name to enhance readability and performance.

@egekurt123 egekurt123 requested a review from a team as a code owner June 22, 2024 21:25
@github-actions github-actions bot added the server Pull requests that update Java code. (Added Automatically!) label Jun 22, 2024
coderabbitai[bot]

This comment was marked as outdated.

laadvo
laadvo previously approved these changes Jun 23, 2024
Copy link
Contributor

@laadvo laadvo 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 ts4, the issue of replying in group chats has been fixed

pzdr7

This comment was marked as resolved.

coderabbitai[bot]
coderabbitai bot previously approved these changes Jun 26, 2024
@ls1intum ls1intum deleted a comment from coderabbitai bot Jun 26, 2024
…ads-groupchats-lazyfetch' into bugfix/communication/answer-threads-groupchats-lazyfetch
Copy link

coderabbitai bot commented Jun 26, 2024

Walkthrough

The GroupChat class was updated to enhance the generation of human-readable group chat names. The generateName method was improved to create names based on participants' names. Additionally, the setName method was simplified to return the chat's name directly, while the logic in getHumanReadableNameForReceiver was streamlined.

Changes

File Path Change Summary
src/main/java/de/tum/in/www1/artemis/domain/metis/conversation/GroupChat.java Enhanced generateName method for better readability based on participant names. Simplified setName method. Streamlined getHumanReadableNameForReceiver.

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 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @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.
  • Please see the configuration documentation for more information.
  • 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/schema.v2.json

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]

This comment was marked as outdated.

Copy link
Contributor

@az108 az108 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 TS3 and works as expected and no internal server error was thrown.
image
Code LGTM aswell 👍

Copy link
Contributor

@laadvo laadvo left a comment

Choose a reason for hiding this comment

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

Reapprove, tested on ts6. Answering in a group chat thread works without any errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix component:Communication ready for review server Pull requests that update Java code. (Added Automatically!) small
Projects
Status: Ready For Review
Development

Successfully merging this pull request may close these issues.

None yet

5 participants