-
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
File upload exercises
: Fix an issue with old file submissions not being deleted
#7276
Merged
krusche
merged 3 commits into
ls1intum:develop
from
theblobinthesky:bugfix/7275-new-file-doesnt-delete-old-file
Oct 3, 2023
Merged
File upload exercises
: Fix an issue with old file submissions not being deleted
#7276
krusche
merged 3 commits into
ls1intum:develop
from
theblobinthesky:bugfix/7275-new-file-doesnt-delete-old-file
Oct 3, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
the
server
Pull requests that update Java code. (Added Automatically!)
label
Sep 27, 2023
theblobinthesky
changed the title
File Upload : New file submission in file upload exercise does not delete old submission file
File Upload: New file submission in file upload exercise does not delete old submission file
Sep 27, 2023
theblobinthesky
changed the title
File Upload: New file submission in file upload exercise does not delete old submission file
File Upload Exercise: New file submission in file upload exercise does not delete old submission file
Sep 27, 2023
27 tasks
krusche
changed the title
File Upload Exercise: New file submission in file upload exercise does not delete old submission file
File upload exercise: Fix an issue with old file submissions not being deleted
Sep 27, 2023
krusche
changed the title
File upload exercise: Fix an issue with old file submissions not being deleted
Sep 27, 2023
File upload exercise
: Fix an issue with old file submissions not being deleted
krusche
changed the title
Sep 27, 2023
File upload exercise
: Fix an issue with old file submissions not being deletedFile upload exercises
: Fix an issue with old file submissions not being deleted
b-fein
reviewed
Sep 27, 2023
src/main/java/de/tum/in/www1/artemis/domain/FileUploadSubmission.java
Outdated
Show resolved
Hide resolved
JohannesStoehr
approved these changes
Sep 27, 2023
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 to me
Strohgelaender
approved these changes
Sep 28, 2023
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
krusche
approved these changes
Oct 3, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checklist
General
Server
Client
authorities
to all new routes and checked the course groups for displaying navigation elements (links, buttons).Changes affecting Programming Exercises
Motivation and Context
This fixes the issue #7275.
Description
The FileUploadSubmission class contains the filePath attribute which is a public path and has to be converted to an actual path on the file system before being used. In this case the onDelete() function did not convert the path and therefore no old submission file from a file upload exercise could ever be deleted.
I think this is where the breaking change happened: aca8f44#diff-afbf7c4cfa2c701ea17f5d3fc9cae4f94e88f182921364471f35e9f3355e0302R37
Since i wanted to avoid using the FilePathService inside of an entity, i reverted back to the implementation before it broke.
I also added an error message to FileService's schedulePathForDeletion when the file to-be-deleted does not exist to catch such errors reliably in the future.
Steps for Testing
Prerequisites:
Review Progress
Performance Review
Code Review
Manual Tests
Exam Mode Test
Test Coverage
Screenshots