Skip to content
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

A bug of which is regarding Preferences in v0.8.13 #788

Closed
asmsuechan opened this issue Aug 10, 2017 · 23 comments
Closed

A bug of which is regarding Preferences in v0.8.13 #788

asmsuechan opened this issue Aug 10, 2017 · 23 comments

Comments

@asmsuechan
Copy link
Contributor

asmsuechan commented Aug 10, 2017

context

A bug which is related to setting contains in v0.8.13 released on 10th August.

symptom

When you update to v0.8.13, your settings will be reset and be volatile even though you change them and restart Boostnote.

solution

If you have updated already, please put ~/.boostnoterc of which content is like below.

{
    "amaEnabled": true, 
    "editor": {
        "fontFamily": "Monaco, Consolas",
        "fontSize": "14",
        "indentSize": "2",
        "indentType": "space",
        "keyMap": "vim",
        "switchPreview": "BLUR",
        "theme": "monokai"
    },
    "hotkey": {
        "toggleFinder": "Cmd + Alt + S",
        "toggleMain": "Cmd + Alt + L"
    },
    "isSideNavFolded": false,
    "listStyle": "DEFAULT",
    "listWidth": 174,
    "navWidth": 200,
    "preview": {
        "codeBlockTheme": "dracula",
        "fontFamily": "Lato",
        "fontSize": "14",
        "lineNumber": true
    },
    "sortBy": "UPDATED_AT",
    "ui": {
        "defaultNote": "ALWAYS_ASK",
        "disableDirectWrite": false,
        "theme": "default"
    },
    "zoom": 1
}

Also, you can pick things what only you want to set.

{
  "editor": {
    "keyMap": "vim",
    "theme": "monokai"
  },
  "hotkey": {
    "toggleMain": "Control + L"
  },
  "listWidth": 174,
  "navWidth": 130
}

I've already fixed this issue and we plan to release this in 2 days.
#787

@asmsuechan asmsuechan changed the title A bug in v0.8.13 A bug of which is regarding Preferences in v0.8.13 Aug 10, 2017
@MattKunze
Copy link

Creating the config file manually isn't working for me, I'm still getting the default settings every time the app starts. Guess I'll wait for the next update

@MrBMT
Copy link
Contributor

MrBMT commented Aug 10, 2017

Like MattKunze mentioned, creating the .boostnoterc file isn't working for me either.

@vvs
Copy link

vvs commented Aug 10, 2017

Same here, my preferences are gone, and are being reset after each restart.

@asmsuechan
Copy link
Contributor Author

asmsuechan commented Aug 10, 2017

@MattKunze @MrBMT @vvs Sorry for inconvenient. Umm, it's bizarre. It's working in my environment. Do you mind if I ask you more detail such as your OS or the exact content of ~/.boostnoterc?

@MrBMT
Copy link
Contributor

MrBMT commented Aug 10, 2017

@asmsuechan

OS: macOS Sierra (v10.12.6)

~/.boostnoterc contents:

{
    "editor": {
        "fontFamily": "Menlo, Monaco, Consolas",
        "fontSize": "13",
        "indentSize": "4",
        "indentType": "space",
        "keyMap": "vim",
        "switchPreview": "BLUR",
        "theme": "monokai"
    },
    "hotkey": {
        "toggleFinder": "Cmd + Alt + S",
        "toggleMain": "Cmd + Alt + L"
    },
    "isSideNavFolded": false,
    "listStyle": "DEFAULT",
    "listWidth": 174,
    "navWidth": 200,
    "preview": {
        "codeBlockTheme": "dracula",
        "fontFamily": "Menlo, Lato",
        "fontSize": "13",
        "lineNumber": true,
    },
    "sortBy": "UPDATED_AT",
    "ui": {
        "defaultNote": "ALWAYS_ASK",
        "disableDirectWrite": false,
        "theme": "default"
    },
    "zoom": 1
}

@MattKunze
Copy link

Same content/environment for me, I just copy/pasted your example to start with

Really the only thing I want is to move the toggleFinder shortcut - it conflicts with 'Save All' in Atom for me

@asmsuechan
Copy link
Contributor Author

asmsuechan commented Aug 10, 2017

Oh, I assume the .boostnoterc.sample is broken. Just a moment, I'll fix it.

@MattKunze So, I assume you should put this

{
    "hotkey": {
        "toggleFinder": "Cmd + Alt + S",
    }
}

@MattKunze
Copy link

Hey, that worked! Previously I was specifying the full set of options like your example and it didn't seem to. That's good enough for me for now, I'll wait for the update to permanently fix it

@asmsuechan
Copy link
Contributor Author

@MattKunze @MrBMT @vvs I found my mistake.
Please remove the comma after "lineNumber": true in preview.

    "preview": {
        "codeBlockTheme": "dracula",
        "fontFamily": "Lato",
        "fontSize": "14",
        "lineNumber": true
    },

@MattKunze
Copy link

Yeah, I did that for the plain hotkey example you listed. Stupid JSON not allowing trailing commas...

@MrBMT
Copy link
Contributor

MrBMT commented Aug 10, 2017

@asmsuechan That fixed it, thanks 😄

@vvs
Copy link

vvs commented Aug 10, 2017

I am on Windows 10. Creating the .boostnoterc file did not help, including the fix with removing comma.

I am also seeing some network activity when trying to monitor the Boostnote behavior (figuring out where it reads/writes).

@asmsuechan
Copy link
Contributor Author

asmsuechan commented Aug 10, 2017

@vvs What appears when you input global.process.env.USERPROFILE in the console of developer tools?

@vvs
Copy link

vvs commented Aug 10, 2017

@asmsuechan It is the standard C:\users\vvs. And looking at the procmon, I see that Boostnote accesses the C:\users\vvs\.boostnoterc file, but its content never changes, and all the settings are reset after each restart.

@vvs
Copy link

vvs commented Aug 10, 2017

Also, looking at the devtools, I see various errors popping up from time to time, when I open/edit/save the preferences:

  1. loadmode.js:61 Uncaught TypeError: instance.getOption is not a function
  2. main.js:1 Uncaught TypeError: Cannot read property 'className' of null

@asmsuechan
Copy link
Contributor Author

asmsuechan commented Aug 10, 2017

@vvs

I see that Boostnote accesses the C:\users\vvs.boostnoterc file

Thank you for your investigation.

Umm, I assume the problem is the json file. Have you seen a warning of Boostnote resets the invalid configuration. in the console?


Actually, those errors have happened until a few version earlier. And they don't affect its behaviour, so I'll fix them someday soon.

@vvs
Copy link

vvs commented Aug 10, 2017

@asmsuechan Ok, figured this stuff out. Basically, the .boostnoterc is READ-ONLY, so it never changes when I modify preferences in the app. The problem I had that the referenced Menlo and Lato fonts were not found. Once I removed them and replaced by "Roboto" that exists on my system, the app reads the rc file and adjusts the settings accordingly.

So, at the moment, I can configure BoostNote to what I need, but not via the app, but rather via the direct file editing.

Also, I had to figure out how to disable the analytics (by default, the setting is enabled), and the setting for that is:

"amaEnabled": false

@asmsuechan
Copy link
Contributor Author

You can also change it from UI (ref: #715).

@vvs
Copy link

vvs commented Aug 10, 2017

@asmsuechan When the app is able to save the .boostnoterc, then yes. But currently, it is a one-way road for me, settings are being read from the file, but never written to it.

@asmsuechan
Copy link
Contributor Author

That's right. Please wait for the next update.

@vvs
Copy link

vvs commented Aug 10, 2017

The following patch fixes the problem of inability to save the user configuration for me:

diff --git a/browser/main/lib/ConfigManager.js b/browser/main/lib/ConfigManager.js
index 505e7ab..59e2c4d 100644
--- a/browser/main/lib/ConfigManager.js
+++ b/browser/main/lib/ConfigManager.js
@@ -67,7 +67,7 @@ function get () {

     config = Object.assign({}, DEFAULT_CONFIG, JSON.parse(config))

-    config = Object.assign({}, DEFAULT_CONFIG, boostnotercConfig)
+    // config = Object.assign({}, DEFAULT_CONFIG, boostnotercConfig)
     config = assignConfigValues(config, boostnotercConfig, config)

     if (!validate(config)) throw new Error('INVALID CONFIG')

@asmsuechan
Copy link
Contributor Author

asmsuechan commented Aug 10, 2017

Yes, I already fixed it #787. And thank you for your inspection.

@asmsuechan asmsuechan mentioned this issue Aug 12, 2017
@asmsuechan
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants