-
Notifications
You must be signed in to change notification settings - Fork 10
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
Prevent upload of empty submission corrections #552
Merged
Merged
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
Codecov Report
@@ Coverage Diff @@
## mampf-next #552 +/- ##
==============================================
+ Coverage 66.49% 66.51% +0.02%
==============================================
Files 311 311
Lines 9417 9423 +6
==============================================
+ Hits 6262 6268 +6
Misses 3155 3155
|
fosterfarrell9
previously approved these changes
Oct 30, 2023
fosterfarrell9
approved these changes
Oct 31, 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.
I did some testing in my local setup, and it seems to be working nicely.
Splines
added a commit
that referenced
this pull request
Nov 1, 2023
* Prevent upload of empty files * Add console log for empty file * Add more specific error message for empty files * Validate file size in backend * Improve locale strings * Undo automatic linting * Undo unwanted changes * Reset whitespaces * Fix multiple files stats for bulk upload * Provide info about which file is empty to user
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is a temporary fix for #513 by preventing empty file uploads.
Where in the codebase
To test it in the UI, search for the string":type option"in the codebase. Once you've found the comment, set the size to
0
manually by addingabove. Then, go ahead and upload any file in respective view. You should see a warning and not be able to complete upload.
Backend
Note: this is only a UI fix, not checking this on the backend, users could still upload empty files via POST. We might still want to ship this to prevent basic errors in the frontend during upload and to maybe find the reason for #513.We are also checking for the minimum file size in the backend. To test it, change
to
Then, users are able to upload the empty file in the frontend, but when they click on "Save", it will fail (with the same error message), as the backend validation fails.
Dummy file
Use the following dummy file as an empty file to test with: empty-file.pdf