-
Notifications
You must be signed in to change notification settings - Fork 148
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
Backend errors not shown in record file upload screen and failed files cannot remove #2804
Backend errors not shown in record file upload screen and failed files cannot remove #2804
Comments
Hi @ntarocco, this PR only checks if the file is empty before upload. Backend errors are still not addressed. Can you re-open the issue? We implemented sanity checks that raise a StorageError inherited exception after the file is uploaded if it's corrupted or the file extension doesn't match the content. A similar error can be triggered by raising an UnexpectedFileSizeError after the fp.close() line (https://github.com/inveniosoftware/invenio-files-rest/blob/v2.2.1/invenio_files_rest/storage/pyfs.py#L134). |
This is already checked here. |
The problem is that if any error came from the backend during file upload (not just the empty file error, any backend error), the upload progress bar turns red, but no error message is displayed in the UI. This issue isn't specific to empty files, all backend errors should be visible in the UI. |
Hi @geekdinazor If you are encountering other recurring backend errors, please feel free to open a new issue with clear reproduction steps, and we'll look into it. Also, note that a rewrite of the upload logic is planned soon to support multi-part file uploads, which will likely affect the current implementation, so this issue of showing all back-end errors on the UI could also be addressed as well. |
Hi @Samk13, I think there was a small misunderstanding in the issue. In our implementation, we make additional checks in the backend, namely file format checks, sizes, a couple of Zip Bomb protections and so on... What we want is to float these errors to the front end, so the user can know what went wrong during the file upload, and fix the problems and retry uploading. Is it possible to re-open the issue from the perspective, or if the new file uploader gonna support this as well, we might end up integrating that one as well. Thanks a ton for the hard work, Best regards. |
Hi @hbayindir, |
Package version (if known): 12.0.2
Describe the bug
Backend errors not shown in UI while uploading file to record and failed files cannot remove.
Steps to Reproduce
RECORDS_RESOURCES_ALLOW_EMPTY_FILES = False
flag to invenio.cfg in order to restrict empty files on invenio-rdm instance.Expected behavior
File upload errors from the backend should be displayed in the UI, and failed upload should be removed when trashcan icon clicked.
Screenshots (if applicable)
Additional context
It is essential that all errors originating from the backend are displayed in the UI and all backend errored files must be removable for future use cases.
/cc @hbayindir @hcansu
The text was updated successfully, but these errors were encountered: