-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
fs: do not emit 'finish' before 'open' on writing empty file #29930
Conversation
936bd44
to
c0ba9a2
Compare
The commit has the wrong subsystem prefix. It’s not stream, but rather fs. |
@nodejs/fs |
I tried to amend the commit message but don't have permission to the nxtedition/node.git repo. But I did change the title of this PR to what I would recommend the commit message be changed to. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with commit messages/subsytem changed to fs
(and assuming no CI surprises).
Will run CITGM too to make sure this fixes the multer
issue and doesn't unexpectedly create issues somewhere else.
This comment has been minimized.
This comment has been minimized.
'finish' could previously be emitted before the file has been created when ending a write stream without having written any data. Refs: expressjs/multer#238
c0ba9a2
to
f341a47
Compare
amended commit msg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
CITGM results look great. No multer failures anymore and no new unexpected failures. |
This comment has been minimized.
This comment has been minimized.
'finish' could previously be emitted before the file has been created when ending a write stream without having written any data. Refs: expressjs/multer#238 PR-URL: #29930 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Landed in ba45367. Thanks! |
'finish' could previously be emitted before the file has been created when ending a write stream without having written any data. Refs: expressjs/multer#238 PR-URL: #29930 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
It looks like this may be causing some test failures in userland: see sindresorhus/copy-file#38 https://travis-ci.org/sindresorhus/cp-file/jobs/602461047#L280 In this case, |
previously the first error emitted from the fs readable stream was given this test is doing some monkeypatching in its harness, we can probably just work around that, but wanted to make sure this was intended? |
@boneskull: I'm not sure I'm following. Can you provide a simple example? |
@ronag I can't really, as it's not my code and I don't really understand the intent. But I can tell you that previous to Node.js v12.13.0, the first error emitted from a writable stream in this test case was one w/ https://github.com/sindresorhus/cp-file/blob/master/test/async.js#L244 |
@boneskull would you mind opening a new issue in this repo? Would you mind confirming that Node 12.12.0 was working as expected. |
'finish' could previously be emitted before the file has been
created when ending a write stream without having written any
data.
Refs: expressjs/multer#238
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes