Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Fix bug #7300 (Prefs never saved again after opening ancestor folder of user prefs.json) #7376

Merged
merged 1 commit into from
Apr 2, 2014

Conversation

peterflynn
Copy link
Member

Fix bug #7300 -- ensure that FileSystem always knows we've read the JSON file before we try to write to it. We don't want to enable the 'blind' flag since it will mean we virtually always overwrite external changes to the prefs file, and we don't want to start using file watchers to observe external changes on the fly since we haven't yet deeply tested having multiple watch roots active at once (see #7375).

Also:

contains the user prefs JSON files in its subtree) - ensure that FileSystem
always knows we've read the JSON file before we try to write to it. We
don't want to enable the 'blind' flag since it will mean we virtually
always overwrite external changes to the prefs file, and we don't want to
start using file watchers to observe external changes on the fly since
we haven't yet deeply tested having multiple watch roots active at once.
- Rename confusing "filename" vars in PreferencesBase
- Fix JSLint errors in ProjectManager from #7026
@@ -241,10 +241,10 @@ define(function (require, exports, module) {
/**
* If the filename matches this Storage's path, a changed message is triggered.
*
* @param {string} filename File that has changed
* @param {string} filePath File that has changed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor nit: the preferred nomenclature is pathname

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it? I get 2x as many hits for 'filepath' in our codebase than 'pathname.' I'm not sure we've settled on any strict convention. I'm just certain that 'filename' is misleading here :-)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or I wonder if it should be fullPath to harmonize with the FileSystem nomenclature?

@peterflynn
Copy link
Member Author

@dangoor Do you have cycles to review today, since this is in prefs code?

@dangoor
Copy link
Contributor

dangoor commented Apr 2, 2014

@peterflynn Sure, I will review this today.

@dangoor
Copy link
Contributor

dangoor commented Apr 2, 2014

Review complete. Everything looks fine to me and the change works well. I don't feel likely to be thrown off by any of the nomenclature we discussed, so I wouldn't block this PR on that. If you do want to change the name to pathname or fullPath, feel free to do so and merge without additional review.

@peterflynn
Copy link
Member Author

Thanks for the review! I'l just go ahead & land it now in the interest of getting on with the remaining sprint tasks...

peterflynn added a commit that referenced this pull request Apr 2, 2014
Fix bug #7300 (Prefs never saved again after opening ancestor folder of user prefs.json)
@peterflynn peterflynn merged commit 3286e7e into master Apr 2, 2014
@peterflynn peterflynn deleted the pflynn/fix-userprefs-writes branch April 2, 2014 20:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants