-
Notifications
You must be signed in to change notification settings - Fork 0
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
Ability to show file upload related backend errors to the user during submission. #206
Comments
What is the exact issue here? |
Sorry for the late reply. I didn't receive the notification of your reply somehow. In short, yes. We run these checks after the upload is completed in the frontend, and the checks are done at the backend. If these checks fail somehow (file type, size, etc.), we can't tell this to the user, since there's no way to communicate to the user interface with an error from backend to frontend. In our previous installation (which was a Zenodo clone), it was possible to do that, and we showed the errors to the user with a message, so the user can just re-upload a replacement file for the problematic files. In current form, these are silent errors, which we can't communicate the user in any way. So, we want to make this possible, implement the capability while satisfying InvenioRDM design and code quality standards and contribute back the capability to core. |
It is still not 100% clear to me how you would like to solve this. Let's take an example: I create a new upload, add a file, and a few seconds later, publish. The backend files checks happen afterwards, asynchronously. BTW, I am moving this to the Product's discussions, it is more relevant there as a global feature. |
In our current (Zenodo based) implementation, the checks run as soon as a file is uploaded, and we don't allow a user to hit If check is failed, a red error message box appears on top of the page, saying that "File X is not suitable for upload", and the file is deleted from the list and the backend immediately. Ideally, we'd like to replicate the exact functionality. If you want to look at how its done, I can ask for the code from the guy who implemented it. |
File check procedure is not working asynchronously, After file uploaded completely, as soon as we fetch the filename and file content from storage (local or s3) and check it via our
|
By async, I meant that we don't block the user's ability to continue working on the form, but yes, it's a blocking action at the end of day, since user can't publish anything until all files are cleared for saving. |
Sharing here overview of the discussion we had in the 26/11 InvenioRDM telecon with @hbayindir and @Samk13 (cc @ntarocco):
|
Thanks a lot for the summary. Keeping it here will be very useful going forward. I'll also steal some links for my internal version which I need for internal dissemination. :) |
Is your feature request related to a problem? Please describe.
We have implemented a file validation procedure for uploaded files in our fork of
invenio-files-rest
package to enhance user security and improve sustainability of the uploaded data in our local instance, Aperta. In short, we make sure that the files are in the formats we like, there are no nasty surprises inside, and files are intact and openable.However, when a user encounters an error, or rejected by one of these filters, we can't notify them about what happened.
This feature is a carryover from our old Aperta installation, which was a fork of Zenodo, and we were able to show these notifications on that version.
Describe the solution you'd like
We want to be able to notify the user about problems in their file(s), and what failed. So they can fix the problem and send the correct version/alternative of the file instead.
Describe alternatives you've considered
Since there's no way to communicate these errors and float them towards the UI and the user, we were unable to find any other alternatives.
Additional context
The things we do are as follows:
tar
(tar
,tar.gz
,tar.bz2
,tar.xz
) andzip
compressed files to detect any issues during extraction.Rar
and7z
formats are not supported;rar
is a proprietary format, and reliable health checks for both formats would require third-party libraries, which we aim to avoid.If files pass all these checks, they're accepted as valid download, otherwise we reject them with an error. For a detailed explanation of what we do, please see the flowchart added below.
The file validation checks are executed once the file has fully uploaded, allowing us to perform integrity checks on compressed formats. If any validation fails, the file is immediately deleted from storage, and a
FileCheckError
—a custom exception inheriting fromStorageError
— is raised to indicate the failure.This is where the problem surfaces. Unfortunately there is no support in InvenioRDM for showing this kind custom upload errors in UI. To be able to inform the user about the problem in a detailed manner, we want these errors to be visible in the UI, and want to introduce this feature into the file uploader(s) InvenioRDM has. There're talks about a new file uploader, and if that one will be the default, we'd love to add the support for it. Otherwise we want to introduce the feature to the old one and hopefully backport it to the newer one in due course.
Any help and guidance is greatly appreciated.
Flowchart:
P.S.: You can ping me and @geekdinazor about this issue. As I aforementioned, we want to implement and contribute this, if accepted. We may need some help from you.
The text was updated successfully, but these errors were encountered: