Uh oh!
There was an error while loading. Please reload this page.
stream: hide afterWriteTickInfo property - #31287
Conversation
nodejs-github-bot
commented
Jan 9, 2020
BridgeAR
commented
Jan 9, 2020
@Hakerh400 maybe also add a regression test? |
mscdex
commented
Jan 9, 2020
Perhaps we can find a better way to do this? |
BridgeAR
commented
Jan 9, 2020
Using a symbol instead should have less performance impact. |
mscdex
commented
Jan 9, 2020
This also needs a test. |
jasnell
commented
Jan 10, 2020
This is also likely semver-major. |
jasnell
left a comment
There was a problem hiding this comment.
Moving to an internal symbol and aliasing afterWriteTickInfo is likely the better option here.
Hakerh400
commented
Jan 10, 2020
Changed to a symbol and added a test. I don't think this should be a semver-major. The PR that introduced this property was released in a semver-minor release (and could propably be a semver-patch). This PR can be considered as a fix for a broken use case. |
mscdex
commented
Jan 10, 2020
Benchmarks with symbol: |
Trott
commented
Jan 12, 2020
@jasnell LGTY? |
There was a problem hiding this comment.
I'm a little curious about this stringify the stream state use case. That's not really something I believe we support and expecting stringify/parse to work could be a bit dangerous, e.g. if you have callbacks buffered.
I would at least like a test here to avoid similar regressions.
Uh oh!
There was an error while loading. Please reload this page.
Hakerh400
commented
Jan 12, 2020
I agree, it is not documented anywhere that a stream object should not contain circular structures. That is why initially I didn't add any test, but @BridgeAR and @mscdex were explicit about adding a test. The point of this PR is to fix a use case in which a code stopped working after a semver-minor release, which may leave users unprepared. I am more than happy to remove the test if we all agree. |
ronag
commented
Jan 12, 2020
The test is fine. I’m actually asking whether we should add further tests. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
nodejs-github-bot
commented
Jan 14, 2020
nodejs-github-bot
commented
Jan 16, 2020
Hakerh400
commented
Jan 23, 2020
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Pull request #30710 has introduced afterWriteTickInfo property for optimizing synchronous write completions and it is backported to v12.x as a semver-minor release, but it breaks use case of JSON stringifying writable stream object. This PR hides that property behind a symbol.
nodejs-github-bot
commented
Feb 5, 2020
Given that #31187 has landed without explicit enumerability, I tend to assume that we have decided what the consensus regarding this topic is to omit default values in object property definitions. Removed default |
Pull request #30710 has introduced
afterWriteTickInfoproperty for optimizing synchronous write completions and it is backported to v12.x as a semver-minor release, but it breaks use case of JSON stringifying writable stream object. This PR hides that property behind a symbol.Fixes#31277
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes