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

Development: Prevent unnecessary requests to the server for IRIS availability in the exercise view #8502

Merged

Conversation

Hialus
Copy link
Member

@Hialus Hialus commented Apr 29, 2024

Checklist

General

Client

  • Important: I implemented the changes with a very good performance, prevented too many (unnecessary) REST calls and made sure the UI is responsive, even with large data.
  • I strictly followed the client coding and design guidelines.
  • I documented the TypeScript code using JSDoc style.

Motivation and Context

We had quite a bit of unwanted request spam in the student exercise view.
image (5)
image (6)

Description

This as caused by some missing unsubscribes, which I added in this PR.

Steps for Testing

Prerequisites:

  • 1 Student
  • Multiple Programming exercises in one course
  1. Log in to Artemis
  2. Go to the course student exercise view
  3. Switch between the exercises
  4. In the network tab there should not be an every increasing spam of requests for the same few URLs

Testserver States

Note

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






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

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Test Coverage

Unchanged

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced the chatbot button component to manage route parameters more efficiently.
    • Improved memory management in the course exercise details component by ensuring subscriptions are properly unsubscribed before renewing.

Copy link

coderabbitai bot commented Apr 29, 2024

Warning

Rate Limit Exceeded

@Hialus has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 16 minutes and 2 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between 30aa4d8 and 8c235c0.

Walkthrough

The recent changes focus on enhancing subscription management in two components. These updates aim to ensure proper subscription initialization and cleanup to prevent memory leaks and maintain code cleanliness in the chatbot-button.component and course-exercise-details.component.

Changes

File Path Changes
.../exercise-chatbot/chatbot-button.component.ts Added a new subscription property and managed route parameter subscription.
.../overview/exercise-details/course-exercise-details.component.ts Improved subscription handling and initialized irisSettings to undefined.

Possibly related issues


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.

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.
  • 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.

@github-actions github-actions bot added the client Pull requests that update TypeScript code. (Added Automatically!) label Apr 29, 2024
@krusche krusche added this to the 7.0.3 milestone Apr 29, 2024
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

…nent.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

coderabbitai[bot]
coderabbitai bot previously approved these changes Apr 29, 2024
Copy link
Contributor

@Strohgelaender Strohgelaender left a comment

Choose a reason for hiding this comment

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

code

Copy link
Contributor

@egekurt123 egekurt123 left a comment

Choose a reason for hiding this comment

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

Code LGTM,
tested manually on TS2, looks fine

@Hialus Hialus added ready to merge maintainer-approved The feature maintainer has approved the PR labels Apr 29, 2024
@krusche krusche changed the title General: Fix missing unsubscribes causing a spam of requests to the server Development: Prevent unnecessary requests to the server May 1, 2024
@krusche krusche changed the title Development: Prevent unnecessary requests to the server Development: Prevent unnecessary requests to the server for IRIS availability in the exercise view May 1, 2024
@krusche krusche merged commit 2a6d9a5 into develop May 1, 2024
55 of 59 checks passed
@krusche krusche deleted the bugfix/fix-missing-unsubscribes-causing-request-spam branch May 1, 2024 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix client Pull requests that update TypeScript code. (Added Automatically!) maintainer-approved The feature maintainer has approved the PR ready for review ready to merge
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants