-
Notifications
You must be signed in to change notification settings - Fork 30k
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
streams: fix fd is null when calling clearBuffer #50994
Conversation
Review requested:
|
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
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.
Can you please add a test?
Resolved. PTAL |
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.
Thank you for your contribution
fileWriteStream.on('finish', () => { | ||
const writtenData = fs.readFileSync(filepath, 'utf8'); | ||
assert.strictEqual(writtenData, data); | ||
}); |
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.
fileWriteStream.on('finish', () => { | |
const writtenData = fs.readFileSync(filepath, 'utf8'); | |
assert.strictEqual(writtenData, data); | |
}); | |
fileWriteStream.on('finish', common.mustCall(() => { | |
const writtenData = fs.readFileSync(filepath, 'utf8'); | |
assert.strictEqual(writtenData, data); | |
})); |
lib/internal/streams/writable.js
Outdated
if ((state[kState] & (kDestroyed | kBufferProcessing | kCorked | kBuffered)) !== kBuffered || | ||
(state[kState] & (kDestroyed | kBufferProcessing | kCorked | kConstructed)) !== kConstructed) { |
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.
if ((state[kState] & (kDestroyed | kBufferProcessing | kCorked | kBuffered)) !== kBuffered || | |
(state[kState] & (kDestroyed | kBufferProcessing | kCorked | kConstructed)) !== kConstructed) { | |
if ((state[kState] & (kDestroyed | kBufferProcessing | kCorked | kBuffered | kConstructed)) !== (kBuffered | kConstructed)) { |
Resolved |
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
Landed in 639c366 |
@mcollina Is this already in the latest release? I am still getting the error. |
this should be in v21.5.0. |
Thanks. 21 works. 20 doesn't but isn't a problem as I could simply update to 21. |
Fixes: #50979