Boostnote: A bug of which is regarding `Preferences` in v0.8.13

Created on 10 Aug 2017  路  23Comments  路  Source: BoostIO/Boostnote

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.
https://github.com/BoostIO/Boostnote/pull/787

Most helpful comment

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

All 23 comments

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

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

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

@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?

@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
}

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

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",
    }
}

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

@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
    },

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

@asmsuechan That fixed it, thanks 馃槃

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).

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

@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.

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

@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.

@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

You can also change it from UI (ref: https://github.com/BoostIO/Boostnote/pull/715).

@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.

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

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')

Yes, I already fixed it https://github.com/BoostIO/Boostnote/pull/787. And thank you for your inspection.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aurelkurtula picture aurelkurtula  路  3Comments

Ocanamat picture Ocanamat  路  3Comments

dtgay picture dtgay  路  3Comments

NonlinearFruit picture NonlinearFruit  路  3Comments

Rokt33r picture Rokt33r  路  3Comments