Cannot close program when no note is open

Bug report

I am unable to close the program when no note editor is currently open.

Environment

  • Platform: Windows
  • Platform version: 11
  • App Version: 5.11.4

How to reproduce

  1. Navigate to a note
  2. Delete the note while it’s open in the editor
  3. See Inkdrop display the no note/open editor state
  4. Try to close Inkdrop

Hi @Magnus ,

I suspect that one of the installed plugins is causing the issue as I couldn’t reproduce it.
What I tried is:

  1. Run the following snippet in the developer console:
const {actions} = require('inkdrop')
inkdrop.store.dispatch(actions.editor.close())
  1. Close the window

Can you share the stacktrace?

I only have the following two plugins installed on this Inkdrop install:

  • inkdrop-note-templates v1.1.0
  • toc (official) v3.2.0

I disabled all plugins before trying your snippet which for me resulted in a reproduction of the bug.

This is my dev console log after running the snippet and trying to close the application

index.html?windowType=full&entry=main&dark-ui=1&windowId=1:77 isDarkMode? true
const {actions} = require('inkdrop')
inkdrop.store.dispatch(actions.editor.close())
Promise {<fulfilled>: undefined}[[Prototype]]: Promise[[PromiseState]]: "fulfilled"[[PromiseResult]]: undefined
browser-main.js:2 Uncaught (in promise) AssistiveError: No active editor
    at gp.getActiveEditorOrThrowError (browser-main.js:2:1054230)
    at zd (browser-main.js:2:1024235)
    at gp.saveAppState (browser-main.js:2:1051945)
    at gp.unload (browser-main.js:2:1055261)
getActiveEditorOrThrowError @ browser-main.js:2
zd @ browser-main.js:2
saveAppState @ browser-main.js:2
unload @ browser-main.js:2
Promise.then (async)
handleUnload @ browser-main.js:2

I also tried enabling logging while reproducing the bug and got the following log

PS C:\Users\USER_NAME> C:\Users\USER_NAME\AppData\Local\inkdrop\app-5.11.4\Inkdrop.exe --enable-logging
PS C:\Users\USER_NAME>
  app:info Creating app window +0ms
  app:info Initializing inkdrop app.. +168ms
  app:info Starting the main process.. +2ms
  app:info axios default config: { proxy: false, httpAgent: undefined, httpsAgent: undefined } +1ms
  app:info Starting a session +32ms
  app:info Finished starting the main process +164ms
  app:info Command line argument: C:\Users\USER_NAME\AppData\Local\inkdrop\app-5.11.4\Inkdrop.exe +0ms
  app:info Arguments: C:\Users\USER_NAME\AppData\Local\inkdrop\app-5.11.4\Inkdrop.exe +0ms
  app:info Command line argument: --enable-logging +1ms
  app:info Arguments: --enable-logging +0ms
[24868:0531/142933.193:INFO:CONSOLE(77)] "isDarkMode? true", source: file:///C:/Users/USER_NAME/AppData/Local/inkdrop/app-5.11.4/resources/app.asar/index.html?windowType=full&entry=main&dark-ui=1&windowId=1 (77)
[24868:0531/142940.177:ERROR:CONSOLE(1)] "Request Autofill.enable failed. {"code":-32601,"message":"'Autofill.enable' wasn't found"}", source: devtools://devtools/bundled/core/protocol_client/protocol_client.js (1)
[24868:0531/142940.177:ERROR:CONSOLE(1)] "Request Autofill.setAddresses failed. {"code":-32601,"message":"'Autofill.setAddresses' wasn't found"}", source: devtools://devtools/bundled/core/protocol_client/protocol_client.js (1)
[24868:0531/142948.966:INFO:CONSOLE(2)] "Uncaught (in promise) AssistiveError: No active editor", source: file:///C:/Users/USER_NAME/AppData/Local/inkdrop/app-5.11.4/resources/app.asar/browser-main.js (2)
  app:info Unloading app +31s
1 Like

ahh, saveAppState! Got it! Thank you