Skip to content
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

ContentUploader: Why is there no complete event when an error event occurs? #2943

Open
silent-e opened this issue Jun 29, 2022 · 0 comments
Open

Comments

@silent-e
Copy link

silent-e commented Jun 29, 2022

Say someone is uploading multiple files in a ContentUploader element. If even one file results in an error event being fired but all others succeed why is there still no complete event firing? The files that did not fail are still uploaded but there's no complete event emitted with its useful info that we can capture and still use. complete doesn't necessarily equate to success. Just that a particular upload set has completed.

I have listeners on each event and would like to still let my users know that some files were uploaded and some had errors.

The use case here is after a successful round of uploading files I'm firing off an xhr request to my server with the complete Files array so I can send an email to the people who need to know it happened. However if I have one file of many that results in an error, maybe a bad filename or just a glitch in The Matrix 🐈‍⬛ , then I don't get any information about the successful uploads, just the one file that errors. So I'm left with sending that information to the server instead which could fire off a different email saying "uploads may have happened but something broke so go check anyways" which is an awful user experience.

I'm pondering capturing every upload event and sending an xhr request to the server which will capture all uploads for later processing. But that will have to rely on a periodic event to do the processing since the error event might happen first so it can't trigger the later processing.

IMHO, There really should to be a complete event after the uploads are done, whether or not everything was successful. Perhaps it becomes the payload is arrays for successful and error upload file results and the current complete event becomes a success event if nothing bad happens.

matte

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants