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

Editor preferences are reverted to default on subsequent launches of Brackets. #6647

Closed
RaymondLim opened this issue Jan 26, 2014 · 8 comments

Comments

@RaymondLim
Copy link
Contributor

  1. Delete Brackets cache (and the new brackets.json preferences file).
  2. Launch Brackets sprint 35.
  3. Change some editor settings so that you can test on preferences migration. I turn off Word Wrap, Line Numbers and turn on Highlight Active Line.
  4. Quit sprint 35.
  5. Launch sprint 36 and verify that all the changes you made in sprint 35 are migrated.
  6. Quit and relaunch sprint 36 (or press Cmd-R to reload).

Result: All editor settings are restored to default and you lost all migration.

@ghost ghost assigned dangoor Jan 26, 2014
@RaymondLim
Copy link
Contributor Author

I can only reproduce it on Mac with my own build. So can someone verify it on a different mac?

@redmunds
Copy link
Contributor

Yes, I saw it too.

@dangoor
Copy link
Contributor

dangoor commented Jan 26, 2014

I'm going to call this high priority for sprint 36 and look into this first thing Monday morning, because I'd rather not see preference conversion problems roll out in Sprint 36.

Offhand, I'm not sure how this might happen.

@RaymondLim
Copy link
Contributor Author

Actually, the issue is not in migration. Currently, we no longer create a new brackets.json file. So the new preferences model is totally broken if you launch sprint 36 even without having any cache to migrate. After the first launch and you change some settings, those settings won't stick.

@RaymondLim
Copy link
Contributor Author

@dangoor This was introduced by pull request #6619 that adds a session scope.

@dangoor
Copy link
Contributor

dangoor commented Jan 26, 2014

@RaymondLim You're right. The root cause appears to be a bug in addScope:

pm._manager._defaultContext.scopeOrder
["path:/Users/dangoor/projects/brackets/.brackets.json", "user", "session", "default"]

session scope should be the first one listed but not the one immediately preceding default. Because session is immediately preceding default, that is where the converted prefs are going.

If the fix for addScope turns out to be complex in some way, then I'll likely take the initial step of removing the session scope from Sprint 36.

@busykai
Copy link
Contributor

busykai commented Jan 26, 2014

@dangoor I don't get it. Did I screw up big time when I validated 6619?.. I didn't see any modifications on the file system.

I did roll back to the commit which adds scope and I'm seeing the same order and modified file when I tweak the settings. :(

@RaymondLim RaymondLim mentioned this issue Jan 26, 2014
@dangoor
Copy link
Contributor

dangoor commented Jan 26, 2014

Ahh, yes. This isn't actually a bug in addScope, which explains why the tests didn't catch the problem.

dangoor added a commit that referenced this issue Jan 27, 2014
busykai added a commit to busykai/brackets that referenced this issue Jan 27, 2014
Load preferences always instead on positive cases.
Also, resolve and reject deferred on negative flows in addScope.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants