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

Notes do not open in the editor #37

Closed
smkuehnhold opened this issue Apr 15, 2021 · 14 comments
Closed

Notes do not open in the editor #37

smkuehnhold opened this issue Apr 15, 2021 · 14 comments
Labels
wontfix This will not be worked on

Comments

@smkuehnhold
Copy link

smkuehnhold commented Apr 15, 2021

Describe the bug
I am not able edit notes directly with this extension. However, I can still do many other things, including deleting notes/notebooks, creating notes/notebooks, removing tags, creating tags, toggling todo states etc. I am also able to view the contents of all of my notebooks within the sidebar. Creating a note with the command palette results in the note being created, but it does not open in the editor.

To Reproduce
Steps to reproduce the behavior:

  1. Open joplin-vscode-plugin sidebar
  2. Click on any note
  3. See error

Alternatively

  1. Open vscode command palette
  2. Type in Joplin: Create note
  3. Type in a name
  4. See error

Expected behavior
A working copy of the note is opened in an editor pane when a note is created, or when a note is selected in the sidebar.

Error Stack Trace

log.ts:197   ERR Request failed with status code 404: Error: Request failed with status code 404
	at createError (/home/smkuehnhold/.vscode/extensions-Markdown/rxliuli.joplin-vscode-plugin-0.4.5/node_modules/axios/lib/core/createError.js:16:15)
	at settle (/home/smkuehnhold/.vscode/extensions-Markdown/rxliuli.joplin-vscode-plugin-0.4.5/node_modules/axios/lib/core/settle.js:17:12)
	at IncomingMessage.handleStreamEnd (/home/smkuehnhold/.vscode/extensions-Markdown/rxliuli.joplin-vscode-plugin-0.4.5/node_modules/axios/lib/adapters/http.js:244:11)
	at IncomingMessage.emit (events.js:228:7)
	at endReadableNT (_stream_readable.js:1185:12)
	at processTicksAndRejections (internal/process/task_queues.js:81:21)

Desktop (please complete the following information):

  • OS: [Debian 10 (Buster)]
  • Joplin platform-version [cli-1.6.4 (prod)]
  • VSCode version [1.52.1 (x64)]
  • joplin-vscode-plugin version [0.4.5]

Additional context

joplin editor: code --wait --extensions-dir .vscode/extensions-Markdown/ --user-data-dir .config/Code-Markdown

Using joplin cli directly and running joplin edit <NOTE> works without issue.

@smkuehnhold smkuehnhold changed the title Unable to edit notes Notes do not open in the editor Apr 15, 2021
@rxliuli
Copy link
Owner

rxliuli commented Apr 15, 2021

Try to change code --wait --extensions-dir .vscode/extensions-Markdown/ --user-data-dir .config/Code-Markdown to code

@rxliuli rxliuli added the question Further information is requested label Apr 15, 2021
@smkuehnhold
Copy link
Author

I did as you instructed (after re-configuring and installing the extension in the default extensions-dir), but still appear to have the same issues. Clicking a note in the sidebar does not open a working copy in the editor.

@smkuehnhold
Copy link
Author

I'm not sure if this is relevant, but when I try to open a note with the extension, I get something like the following in the joplin-web-clipper server logs.

22:30:24: Request: POST /services/externalEditWatcher?token=<REDACTED_TOKEN>
22:30:24: Error: No action API has been setup!

@rxliuli
Copy link
Owner

rxliuli commented Apr 15, 2021

I'm not sure if this is relevant, but when I try to open a note with the extension, I get something like the following in the joplin-web-clipper server logs.

22:30:24: Request: POST /services/externalEditWatcher?token=<REDACTED_TOKEN>
22:30:24: Error: No action API has been setup!

Yes, this seems to mean that your Joplin client does not have note action related APIs. Can you test the latest version of Joplin?

Note action api is a new api added after 1.4, and it is indeed not found in the official api documentation. . .

@smkuehnhold
Copy link
Author

Running joplin version yields joplin 1.6.4 (prod). This should satisfy the constraint that Joplin be greater than version 1.4 correct? Is there perhaps a different branch that I need to install?

@rxliuli
Copy link
Owner

rxliuli commented Apr 15, 2021

Error: No action API has been setup! Under what circumstances does this error occur? @laurent22

@smkuehnhold
Copy link
Author

I installed the CLI client using the recommended method via npm. Are you aware if the action API is possibly implemented in a separate package?

@rxliuli
Copy link
Owner

rxliuli commented Apr 15, 2021

Can you try the following commands?

Pay attention to replace token/port/noteId

curl --location --request POST 'http://localhost:27584/services/externalEditWatcher?token=***' \
--header 'Content-Type: application/json' \
--data-raw '{
    "action": "openAndWatch",
    "noteId": "257f6a9dacc1409580ee526d50ac4d49"
}'

If you still can’t open it in the editor, you probably need to ask @laurent22

@smkuehnhold
Copy link
Author

Just to clarify, the port and token are the same ones I specified for your extension correct? And the noteId is simply the id of one of my notes?

@rxliuli
Copy link
Owner

rxliuli commented Apr 15, 2021

Just to clarify, the port and token are the same ones I specified for your extension correct? And the noteId is simply the id of one of my notes?

Yes

@smkuehnhold
Copy link
Author

😬

{"error":"No action API has been setup!: \n\nError: No action API has been setup!\n    at Api.<anonymous> (/home/smkuehnhold/.joplin-bin/lib/node_modules/joplin/node_modules/@joplin/lib/services/rest/Api.js:153:23)\n    at Generator.next (<anonymous>)\n    at /home/smkuehnhold/.joplin-bin/lib/node_modules/joplin/node_modules/@joplin/lib/services/rest/Api.js:8:71\n    at new Promise (<anonymous>)\n    at __awaiter (/home/smkuehnhold/.joplin-bin/lib/node_modules/joplin/node_modules/@joplin/lib/services/rest/Api.js:4:12)\n    at Api.action_services (/home/smkuehnhold/.joplin-bin/lib/node_modules/joplin/node_modules/@joplin/lib/services/rest/Api.js:149:16)\n    at Api.<anonymous> (/home/smkuehnhold/.joplin-bin/lib/node_modules/joplin/node_modules/@joplin/lib/services/rest/Api.js:114:41)\n    at Generator.next (<anonymous>)\n    at /home/smkuehnhold/.joplin-bin/lib/node_modules/joplin/node_modules/@joplin/lib/services/rest/Api.js:8:71\n    at new Promise (<anonymous>)"}

you probably need to ask @laurent22

How should I go about doing that? Should I open an issue in the Joplin repo?

@rxliuli
Copy link
Owner

rxliuli commented Apr 15, 2021

😬

{"error":"No action API has been setup!: \n\nError: No action API has been setup!\n    at Api.<anonymous> (/home/smkuehnhold/.joplin-bin/lib/node_modules/joplin/node_modules/@joplin/lib/services/rest/Api.js:153:23)\n    at Generator.next (<anonymous>)\n    at /home/smkuehnhold/.joplin-bin/lib/node_modules/joplin/node_modules/@joplin/lib/services/rest/Api.js:8:71\n    at new Promise (<anonymous>)\n    at __awaiter (/home/smkuehnhold/.joplin-bin/lib/node_modules/joplin/node_modules/@joplin/lib/services/rest/Api.js:4:12)\n    at Api.action_services (/home/smkuehnhold/.joplin-bin/lib/node_modules/joplin/node_modules/@joplin/lib/services/rest/Api.js:149:16)\n    at Api.<anonymous> (/home/smkuehnhold/.joplin-bin/lib/node_modules/joplin/node_modules/@joplin/lib/services/rest/Api.js:114:41)\n    at Generator.next (<anonymous>)\n    at /home/smkuehnhold/.joplin-bin/lib/node_modules/joplin/node_modules/@joplin/lib/services/rest/Api.js:8:71\n    at new Promise (<anonymous>)"}

you probably need to ask @laurent22

How should I go about doing that? Should I open an issue in the Joplin repo?

Yes, you need to add a question to the joplin official project, stating that you cannot access the action api using curl, and you may also need joplin logs (this api can be used normally when I test here)

@smkuehnhold
Copy link
Author

@rxliuli
Copy link
Owner

rxliuli commented Apr 15, 2021

Looks like you must use the desktop version
ref: https://discourse.joplinapp.org/t/action-api-not-setup-in-1-6-4-cli/16735/3

@rxliuli rxliuli added wontfix This will not be worked on and removed question Further information is requested labels Apr 15, 2021
@rxliuli rxliuli closed this as completed Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants