Uh oh!
There was an error while loading. Please reload this page.
fs: don't alter user provided options object - #7831
Conversation
thefourtheye
commented
Jul 22, 2016
This is a fix for #7655. @micnic@thealphanerd This can be safely backported, if necessary. |
micnic
commented
Jul 22, 2016
LGTM with some comments As I see, in some fs stream prototype constructors About tests, it would be good to have such tests for other methods that receive as parameters user defined objects, cc @nodejs/testing |
There was a problem hiding this comment.
Please add common.mustCall() to the callback.
ef7ad0f to
54db1c6Comparethefourtheye
commented
Jul 22, 2016
There was a problem hiding this comment.
minor nit... s/don't/Don't
(there are multiple comments in this doc that start with lower case that should be uppercase)
jasnell
commented
Jul 26, 2016
LGTM |
thefourtheye
commented
Jul 27, 2016
cc @nodejs/collaborators |
micnic
commented
Jul 27, 2016
LGTM |
yorkie
commented
Jul 30, 2016
|
micnic
commented
Jul 30, 2016
ChALkeR
commented
Jul 31, 2016
@thefourtheye Why does this remove |
ChALkeR
commented
Jul 31, 2016
> Object.create(Object.create({encoding: 'utf8'})).encoding'utf8'
> util._extend({}, Object.create({encoding: 'utf8'})).encodingundefinedDoesn't it make this semver-major? |
yorkie
commented
Jul 31, 2016
@ChALkeR because the
|
ChALkeR
commented
Jul 31, 2016
@yorkie, so, this means that it actually broke those tests? |
yorkie
commented
Jul 31, 2016
Yea, we have to change those cases IMO :-( |
Labeling as semver-major due to a breaking change. Note that it also changes existing tests expectations. Feel free to remove the semver-major label if this will be changed so that all the existing tests pass. Could we keep support for those somehow? Btw, this potentially could break some modules out there, so I'm not even sure if landing this in the current state to 7.0 without a deprecation cycle will be fine. Refs: #7912. Note: it's not |
jasnell
commented
Aug 8, 2016
@nodejs/ctc ... any further thoughts on this? |
silverwind
commented
Aug 8, 2016
What is this |
thefourtheye
commented
Aug 9, 2016
@silverwind We add few properties to |
@thefourtheye Wouldn't something like: still alter the original |
The status post must be wrong as there was a failure on aix even though the check above show as green. I assume this was not seen earlier as the test did not make it that far. |
mhdawson
commented
Oct 5, 2016
Hmm, see it passed in an earlier CI run so not sure why that would fail unless there could be some conflict with temp directory generation and other tests running in parallel ? Failure on PPC was unrelated as its related to the know test-tic-processor-issues covered in: #8725 |
Stress run on AIX https://ci.nodejs.org/job/node-stress-single-test/986/ |
mhdawson
commented
Oct 5, 2016
Seems to fail consistently in stress run, did the test change since the successful CI run ? |
mhdawson
commented
Oct 6, 2016
Investigating locally, believe it may be because the test assumes the write will complete before the read starts which is not guaranteed |
mhdawson
commented
Oct 6, 2016
Yes believe it is a race condition in the test. This version passes reliably: |
7be837a to
1ecce67Comparethefourtheye
commented
Oct 9, 2016
Awesome. Thanks for digging deeper and providing a fix as well, @mhdawson :-) https://ci.nodejs.org/job/node-stress-single-test/989/ is Green. One last CI Run before landing: https://ci.nodejs.org/job/node-test-pull-request/4437/ |
This patch makes a copy of the `options` object before the fs module functions alter it. PR-URL: nodejs#7831Fixes: nodejs#7655 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Nicu Micleușanu <micnic90@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org>
1ecce67 to
e378a56CompareI had to rebase because of the linter rule upgrade. New CI: https://ci.nodejs.org/job/node-test-pull-request/4440/ |
thefourtheye
commented
Oct 9, 2016
FreeBSD failures are not related. Landing this now... |
thefourtheye
commented
Oct 9, 2016
Landed in 7542bdd |
jasnell
commented
Oct 10, 2016
This does not land cleanly on |
thefourtheye
commented
Oct 10, 2016
@jasnell Oh, do you want me to PR this targeting 7.x? |
jasnell
commented
Oct 10, 2016
No no, sorry i wasn't clear. Both prs landed in v7.x-staging, I was just On Monday, October 10, 2016, Sakthipriyan Vairamani <
|
Fishrock123
commented
Oct 10, 2016
Backport PRs will be necessary if desired, this appears to depend on #7165 / I don't know how to resolve easily. |
This patch makes a copy of the `options` object before the fs module functions alter it. PR-URL: nodejs/node#7831Fixes: nodejs/node#7655 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Nicu Micleușanu <micnic90@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org>
This patch makes a copy of the `options` object before the fs module functions alter it. PR-URL: nodejs/node#7831Fixes: nodejs/node#7655 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Nicu Micleușanu <micnic90@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org>
This patch makes a copy of the `options` object before the fs module functions alter it. PR-URL: nodejs/node#7831Fixes: nodejs/node#7655 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Nicu Micleușanu <micnic90@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org>
Checklist
make -j4 test(UNIX), orvcbuild test nosign(Windows) passesAffected core subsystem(s)
fs
Description of change
This patch makes a copy of the
optionsobject before altering it.cc @nodejs/fs