Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.2k
fs: don't alter user provided options object#7831
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
thefourtheye commented Jul 22, 2016 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add common.mustCall() to the callback.
ef7ad0f to 54db1c6Comparethefourtheye commented Jul 22, 2016
lib/fs.js Outdated
jasnellJul 26, 2016 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
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.
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 |
jasnell commented Jul 29, 2016 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
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 :-( |
ChALkeR commented Jul 31, 2016 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
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
thefourtheye commented Aug 9, 2016 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
@silverwind We add few properties to |
claudiorodriguez commented Aug 9, 2016 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
@thefourtheye Wouldn't something like: still alter the original |
mhdawson commented Oct 5, 2016 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
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 |
mhdawson commented Oct 5, 2016 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
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 <[email protected]> Reviewed-By: Nicu Micleușanu <[email protected]> Reviewed-By: Rod Vagg <[email protected]>
1ecce67 to e378a56Comparethefourtheye commented Oct 9, 2016 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
I 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 |
This patch makes a copy of the `options` object before the fs module functions alter it. PR-URL: #7831Fixes: #7655 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Nicu Micleușanu <[email protected]> Reviewed-By: Rod Vagg <[email protected]>
jasnell commented Oct 10, 2016
This does not land cleanly on |
This patch makes a copy of the `options` object before the fs module functions alter it. PR-URL: #7831Fixes: #7655 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Nicu Micleușanu <[email protected]> Reviewed-By: Rod Vagg <[email protected]>
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 <[email protected]> Reviewed-By: Nicu Micleușanu <[email protected]> Reviewed-By: Rod Vagg <[email protected]>
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 <[email protected]> Reviewed-By: Nicu Micleușanu <[email protected]> Reviewed-By: Rod Vagg <[email protected]>
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 <[email protected]> Reviewed-By: Nicu Micleușanu <[email protected]> Reviewed-By: Rod Vagg <[email protected]>
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