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

Team exercises: Fix synchronization for empty submissions #10183

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

Conversation

coolchock
Copy link
Contributor

@coolchock coolchock commented Jan 21, 2025

Checklist

General

Client

Description

When testing #10087, an issue was discovered: text editors do not synchronize properly when one user deletes all text from the editor. This pull request addresses the issue, ensuring this edge case is handled correctly.

Steps for Testing

Prerequisites:

  • 2 Students
  • 1 Team Text Exercise
  1. Start a team text exercise in two browsers (or in an incognito tab).
  2. Type some text in one editor and verify that both users' editors are synchronized.
  3. Delete some parts of the text in one editor and verify that both users' editors remain synchronized.
  4. Delete all text in one editor and verify that both users' editors remain synchronized.

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 client changes (in particular related to REST calls and UI responsiveness) are implemented with a very good performance even for very large courses with more than 2000 students.
  • I (as a reviewer) confirm that the server changes (in particular related to database calls) are implemented with a very good performance even for very large courses with more than 2000 students.

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Summary by CodeRabbit

  • New Features

    • Enhanced text editor component to utilize the ButtonComponent.
    • Improved test coverage for submission handling.
  • Bug Fixes

    • Ensured answer property is correctly initialized when submission is empty.

@coolchock coolchock requested a review from a team as a code owner January 21, 2025 11:43
@github-actions github-actions bot added tests client Pull requests that update TypeScript code. (Added Automatically!) labels Jan 21, 2025
@coolchock coolchock added small text Pull requests that affect the corresponding module labels Jan 21, 2025
Copy link

coderabbitai bot commented Jan 21, 2025

Walkthrough

The pull request introduces modifications to the text-editor.component.ts file and its corresponding test suite. The changes include updating the import statements to include ButtonComponent and adding a new test case to handle empty submissions from a team. The primary focus is on ensuring proper initialization of the answer property and enhancing test coverage for the component's submission handling logic.

Changes

File Change Summary
src/main/webapp/app/exercises/text/participate/text-editor.component.ts - Updated import statement to include ButtonComponent
- Added initialization of answer to an empty string for empty submissions
src/test/javascript/spec/component/text-editor/text-editor.component.spec.ts - Added new test case should receive empty submission from team
- Verified handling of empty submissions

Possibly related PRs

Suggested labels

bugfix, ready for review, exercise, programming

Suggested reviewers

  • krusche
  • EneaGore
  • SimonEntholzer
  • Feras797
  • vinceclifford
  • HawKhiem

📜 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 840c4a0 and 0423480.

📒 Files selected for processing (1)
  • src/main/webapp/app/exercises/text/participate/text-editor.component.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/webapp/app/exercises/text/participate/text-editor.component.ts
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: client-tests
  • GitHub Check: server-tests
  • GitHub Check: Build and Push Docker Image
  • GitHub Check: Build .war artifact
  • 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. (Beta)
  • @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 Jan 21, 2025
@github-actions github-actions bot removed the text Pull requests that affect the corresponding module label Jan 21, 2025
Copy link

@HawKhiem HawKhiem 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

Screen.Recording.2025-01-21.185533.mp4

@github-actions github-actions bot added deployment-error Added by deployment workflows if an error occured and removed deploy:artemis-test3 labels Jan 21, 2025
@sachmii sachmii removed the deployment-error Added by deployment workflows if an error occured label Jan 21, 2025
@SindiBuklaji SindiBuklaji temporarily deployed to artemis-test2.artemis.cit.tum.de January 21, 2025 22:53 — with GitHub Actions Inactive
Copy link
Contributor

@SimonEntholzer SimonEntholzer left a comment

Choose a reason for hiding this comment

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

Code

@github-actions github-actions bot removed the deployment-error Added by deployment workflows if an error occured label Jan 22, 2025
@zagemello zagemello temporarily deployed to artemis-test1.artemis.cit.tum.de January 22, 2025 13:24 — with GitHub Actions Inactive
Copy link

@zagemello zagemello 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 TS1, all works as expected.

Copy link

⚠️ Unable to deploy to test servers ⚠️

Testserver "artemis-test5.artemis.cit.tum.de" is already in use by PR #10178.

@github-actions github-actions bot added the deployment-error Added by deployment workflows if an error occured label Jan 22, 2025
@vinceclifford vinceclifford added deploy:artemis-test5 deploy:artemis-test1 and removed deployment-error Added by deployment workflows if an error occured deploy:artemis-test5 labels Jan 22, 2025
@vinceclifford vinceclifford temporarily deployed to artemis-test1.artemis.cit.tum.de January 22, 2025 22:06 — with GitHub Actions Inactive
Copy link

@vinceclifford vinceclifford 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 TS1, works as expected.

Copy link

@Feras797 Feras797 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 TS1, the synchronization of team exercises works as described.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Pull requests that update TypeScript code. (Added Automatically!) ready to merge small tests
Projects
Status: Work In Progress
Development

Successfully merging this pull request may close these issues.