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
Writable does not check if stream has been destroyed during _final and _write #39030
Comments
I don't know to be honest as I don't want to make things too stringent. However adding a check is going to improve the developer experience. What should the check do? Throw? emit |
I think:
|
Should we tag this as good first issue? |
@ronag Can i take this up? |
Go for it! |
Hey! I was wondering about the status of this issue, and if I could try looking into it? |
Go for it! |
I went through Writable.js, but I'm not sure where should the checks be added. Specifically, I found these to be already present:
I'll really appreciate some guidance on this |
You need to look at the time between those being called and their callback being invoked. |
Thanks! I followed the code between these two times, and wanted to confirm the location. For This will be for the case when the stream gets destroyed during |
After looking into this, this seems to run counter to a previous pull request (maybe I didn't understand something?): #24062 I can't immediately see a way to throw an error at the start of the callbacks without changing/removing several of the tests. I also foresee some issues with asynchronous implementations of _write and _final (also in the tests). Do we want to go ahead with the change anyway? |
Not sure if this is a problem but I think we should at least add a comment in the code that this case has been considered.
The text was updated successfully, but these errors were encountered: