You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 6, 2021. It is now read-only.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Instead of chaining the adding of the scopes at the caller, scopes are now added in the order the addScope was called. For each scopeOrder, a shadowScopeOrder is maintained which tracks the scope load status. If the scope was specified explicit "before" location and the "before" scope failed to load, it will be added to the first successfully loaded scope after "before". "default" scope is always loaded for the context and it's always resolved.
Deficient $.when is replaced with new Async.waitForAll (which would call always only when all promises are either resolved or rejected).
cc: @dangoor -- this is working, but not mergeable fix for #6660. I'll create task list to complete it later today or tomorrow. Please let me know what you think.
TODO:
load scopes if "before" scope has failed to load
do not require the caller to chain promises to add scopes in order
always create "user" scope, even if the one that has been requested has failed
warn user on corrupt brackets.json ("user" scope) on start-up and open it for editing
make sure preferences are loaded before any extension starts to load
comment/document the implementation
review test failures
refactor the tests to catch async (e.g. load failures)
@dangoor what about creating in-memory user scope when the system fails (due to parse or fs error)? Brackets should also warn that the user prefs cannot be parsed/loaded.
"user" scope is treated differently than the rest of the scopes. if it
fails, then "user" scope is installed using memory storage.
additionally, when it fails due to ParsingError, the user is warned and
the configuration file is loaded so that it could be fixed.
…ions' into fix-6660
Seemingly working merge with current work by @dangoor in adobe#6715.
Conflicts:
src/preferences/PreferencesBase.js
src/preferences/PreferencesManager.js
@dangoor I'm working on merge with master which has #6715. PrefSystem does not get notifications from project scope (which means there's an error in contexts/binds somewhere). As soon as I'm done fixing it, it will be ready for review.
@busykai would you mind merging master into your branch? Sorry for the churn. I think the merge is easy (and did it myself), but I wouldn't want to mess it up!
"ERROR_CREATING_FILE" : "An error occurred when trying to create the {0} <span class='dialog-filename'>{1}</span>. {2}",
// Application preferences corrupt error strings
"ERROR_PREFS_CORRUPT_TITLE" : "Preferences file is corrupt",
"ERROR_PREFS_CORRUPT" : "{APP_NAME} preferences file is not a valid JSON and cannot be parsed. It will now be opened so that you could fix it. You will need to restart or reload {APP_NAME} for the changes to take effect.",
The reason will be displayed to describe this comment to others. Learn more.
How about something like:
"ERROR_PREFS_CORRUPT_TITLE" : "Error reading preferences","ERROR_PREFS_CORRUPT" : "Your preferences file is not valid JSON. The file will be opened so that you can correct the format. You will need to restart {APP_NAME} for the changes to take effect.",
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
None yet
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instead of chaining the adding of the scopes at the caller, scopes are now added in the order the addScope was called. For each scopeOrder, a shadowScopeOrder is maintained which tracks the scope load status. If the scope was specified explicit "before" location and the "before" scope failed to load, it will be added to the first successfully loaded scope after "before". "default" scope is always loaded for the context and it's always resolved.
Deficient $.when is replaced with new Async.waitForAll (which would call always only when all promises are either resolved or rejected).
cc: @dangoor -- this is working, but not mergeable fix for #6660. I'll create task list to complete it later today or tomorrow. Please let me know what you think.
TODO: