-
Notifications
You must be signed in to change notification settings - Fork 325
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
Possible race condition with events #152
Comments
Thanks for reporting this issue. Is this a problem with the code samples and there is a workaround, or it's an API issue? When the upload fails right away is an exception raised or does it fail silently? Do you have any thoughts about a potential solution? |
Hi Mark,
I've been doing a lot of updates to fit some requirements of my project
under my own repo, I've mostly removed android support (not needed and just
increases the apk size) and added some more functions to increase
background execution time and query the remaining time.
For the race condition, my "fix" was just to add a delay to
"_sendEventWithName" so it gives time for event listeners to be setup. It
does not fail silently, it sends the error event normally, but there are no
listeners yet because it happens in the same processing time as the
startUpload call.
I'm sorry I didn't do a fork to make it easier to compare the changes, but
I messed up with the code so much that it probably can't be merged anyways.
…On Mon, Jul 15, 2019 at 12:02 PM Mark Allen ***@***.***> wrote:
Thanks for reporting this issue. Is this a problem with the code samples
and there is a workaround, or it's an API issue? When the upload fails
right away is an exception raised or does it fail silently?
Do you have any thoughts about a potential solution?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#152?email_source=notifications&email_token=ALU263CU3O5FLOXSZ5FLFM3P7SGQJA5CNFSM4IDB5222YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZ57FZY#issuecomment-511439591>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALU263CLPH57UECURHXHU6TP7SGQJANCNFSM4IDB522Q>
.
|
No problem, I appreciate you taking the time to report these issues even tho it sounds like you have solved many of them in your fork.
Sounds like we just need a simple |
Has any progress been made on this? I ran into this issue when S3 immediately rejects a PUT when the header signatures do not match. The request fails silently. My (very loose) work around is to register the error listener first. That seems to catch most of the failures. EDIT: We were actually able to get around this by using a customUploadId and registering event listeners with |
The code samples hint that you should first await startUpload to get the id, and then add the listeners. However, if for some reason the upload fails right away (e.g., file is too large), the error events will not fire for that specific ID (because the listener wasn't added yet). So in this case you will never know if the request failed or not.
The text was updated successfully, but these errors were encountered: