-
Notifications
You must be signed in to change notification settings - Fork 297
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
Programming exercises
: Display error message for unexpected errors on exercise import
#8463
Programming exercises
: Display error message for unexpected errors on exercise import
#8463
Conversation
Programming exercises
: Displaying error message for unexpected errors on exercise importProgramming exercises
: Display error message for unexpected errors on exercise import
…ndling-for-unexpected-errors
WalkthroughThe changes across the files aim to enhance error handling and user feedback mechanisms in the programming exercise update component. These improvements include refining error messages, incorporating utility functions for page scrolling, and enhancing alert displays for better user guidance during error scenarios. Changes
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for testing @pzdr7 #8463 (review), the issue was that the The new solution addresses the issue directly in the |
…ndling-for-unexpected-errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested during testing session, lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worked fine for me during the testing session!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Local Behavior showcased during the testing session, TS Behavior tested manually on TS1 -> Both work as described
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
presented in testing session locally, works as expected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good. Left one comment, but I'll leave it up to you.
…ndling-for-unexpected-errors
…ix-error-handling-for-unexpected-errors # Conflicts: # src/main/java/de/tum/in/www1/artemis/web/rest/programming/ProgrammingExerciseExportImportResource.java
1de7728
The actual issue will be fixed in #8523. The content of this PR will be refined in which I will link here once it is created, addressing a refactoring of the server & client-side error handling. |
Checklist
General
Client
Motivation and Context
A missing error message confused instructors when importing programming exercises with the system in an unexpected state.
An instructor tried to import an exercise and nothing happened (meaning that there was an error in the network tab that was not displayed as an alert in the user interface).
The error occurs in
ProgrammingExerciseExportImportResource.importProgrammingExercise
, most likely related to a duplicated exercise short name that is not covered byProgrammingExerciseRepository.validateCourseSettings
.Description
Adjusting the client side of the programming exercise import display to display an alert for unexpected errors.
alert.service
that intercepts all errors to display an alert for errors where the "error" object is not set but the response is an error (using the header fieldsx-artemisapp-error
andx-artemisapp-message
for the alert, or throwing a generic error message if these are not defined)scrollToTopOfPage
instead of duplicating the codeSteps for Testing
On the test server
alert.service
intercepts all errors)Locally
I do not know how to test the fallback "unexpected error message" on the testserver
I am not sure how to get the system into a state leading to the issue described; I was able to reproduce the state by importing a programming exercise with a duplicate short name and disabling the duplicate check.
Disable the duplicate check
ProgrammingExerciseExportImportResource
classprogrammingExerciseRepository.validateCourseSettings(newExercise, course);
Import a programming exercise with a duplicate short name
An error message should be displayed as alert in the upper right corner
Enable the duplicate check again and verify that only one alert is displayed
In my case the thrown error is
POST http://localhost:9000/api/programming-exercises/import/1?recreateBuildPlans=false&updateTemplate=false 500 (Internal Server Error)
Testserver States
Note
These badges show the state of the test servers.
Green = Currently available, Red = Currently locked
Review Progress
Code Review
Manual Tests
Test Coverage
Client
�
Screenshots
Now
Before
Page just stays open, nothing happens
Summary by CodeRabbit
New Features
Bug Fixes
Tests
Refactor