-
Notifications
You must be signed in to change notification settings - Fork 641
Emit errors from upstream on file upload #426
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
Conversation
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
I believe handleError doesn't need to end the stream. Errors are emitted back to the stream that was passed into ... streams of tears. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
PTAL 😄 |
Emit errors from upstream on file upload
|
👍 |
|
Is it possible that handleError() being called twice? i.e. one error event and one complete event with error come back to back? |
|
It was that the stream was being closed too many times. I believe we have addressed this issue fully. If you want to test against master, that would be wonderful! |
|
I wonder in real network scenario (not just the test mock environment), it is possible that there will be one error event and one complete event+error being emitted back to back with error code all equals to 404 or 499-600. If it happens, the handleError() will be called twice and startUpload() resumeUpload() will be called twice. |
|
The write stream will either emit an error or complete, it can't do both. Regardless, somewhat related, we should aim to "once-ify" our user provided callbacks. |
|
@teddybearz I can't help but feel I'm missing your point. If I am, thanks for your patience. |
BTW, is there a mock environment I can use to test my code that uses this library? So I can simulate bad-upload/bad-download/network-connection-reset those kinds of error cases programmatically? I am tired of pulling cable now 😄 |
|
@teddybearz You might have some luck trying out https://github.com/tylertreat/Comcast 😄 |
This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/b742586e-df31-4aac-8092-78288e9ea8e7/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 325949033 Source-Link: googleapis/googleapis@94006b3
This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/dfbad313-7afb-4cf6-b229-0476fcc2130c/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: googleapis/synthtool@57c23fa
This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/dfbad313-7afb-4cf6-b229-0476fcc2130c/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: googleapis/synthtool@57c23fa
The native bindings have been moved to the pprof module. This module can be pure-JS now.
The native bindings have been moved to the pprof module. This module can be pure-JS now.
The native bindings have been moved to the pprof module. This module can be pure-JS now.
I (think I) have a fix here for #422 but writing the test for it has been troublesome for me, most likely due to my lack of understanding with streams. Hopefully @stephenplusplus can help!
The test is passing (all asserts pass and done is called) and then immediately failing due to stream.end being called on a stream that (I guess) no longer exists?
I'm getting the following error when running the test included in this PR and don't know how to fix: