-
Notifications
You must be signed in to change notification settings - Fork 595
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
GCS: is the correct event 'complete' or 'finish' for uploading? #849
Comments
Great question and one that was recently resolved once and for all. Answer for 0.20.0: complete All writable streams will emit finish when they're done, but the request module which makes all of our requests requires you to latch onto "complete" to get the full response data from the request. That's why we've had to ask users to listen to complete... we needed to be able to confirm the request was successful (confirming data integrity, mostly). In master however, we figured out a way to not require users to listen for complete. PR: #824 Without having more details, I can't reliably guess what happened for the user who had the discrepancy. A possibility is the request finished but was later determined to have not been successful. If their script exited or carried on without waiting for complete, the "finish" event still would have fired making it look like it was successful. Feel free to send them over here though or try master directly, I'll be happy to sort it out. |
There was an error in the branch we was working with the pinned gcloud to master instead of 0.20, which has been resolved. If someone is using master and listening for 'complete', will things still work as expected? |
Ah, I see in the PR that it's a breaking change. We leave this open until the next release? I can update nodejs-getting-started to the new release and fix the event. |
That sounds like a plan, I think we'll be releasing sometime early next week. |
Great, I'll keep an eye on this issue so please close it when you tag the release. |
Will do! |
I was the one to originally post the problem with the In my tests, the However, the version in my |
As of the current stable release (and I believe all releases previous) it's possible that Could you provide a code snippet to reproduce the issue you are seeing? Also, I know you mentioned that you have |
@callmehiphop I've made a little bit of confusion. At the time I got my problem, I was using a For some reason the @jonparrott Just pinned the version in the current package version to Sorry for the confusion. |
@jonparrott -- 0.21.0 just released. |
Thanks, i'll update the tutorials shortly. |
This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/f9f34ae0-d83d-4c7a-a197-54a0a7255ebc/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: googleapis/synthtool@15013ef
When uploading a file, eg:
Is the correct event
complete
orfinish
. The docs saycomplete
, but a user reported an issue with usingcomplete
and thatfinish
was the one that worked for him. In my testing, both work with gcloud 0.20.0.The text was updated successfully, but these errors were encountered: