-
Notifications
You must be signed in to change notification settings - Fork 38
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
[Bug]: joplin-vscode-plugin search stopped working with recent Joplin 3.1.22+ #108
Comments
I am using v3.1.23 and haven't encountered any issues. Perhaps check the FAQ? I apologize that the FAQ link is broken; I will update it. |
I created a new package; can you install and test it locally? There should be more detailed logs now if an error occurs. |
Installed the provided version, same error in the combinded.log:
The other functions seems working well. |
Is only the search function unavailable? |
No, just tried list the 20 recent notes with Ctrl + J, O, same error. But read node and save node is working fine. |
I'm sorry, I made a silly mistake. Could you reinstall and check the logs again? |
combined.log {"level":"info","message":"command execute: joplin.search"} |
List all directories through the following URL and check if http://localhost:41184/folders?as_tree&token=*** |
No, does not exist. |
Okay, let me add some extra logs. I suspect that the database is corrupted, and some notes have incorrect |
Please try again; this time the log should contain notes that indicate the cause of the error, in order to confirm whether the database is corrupted, which may need to be reported to Joplin. joplin-vscode-plugin-1.7.0.vsix.zip You can run the script below to check all notes. npm i -g zx
zx scan.js // scan.js
import { fetch } from 'zx'
const JOPLIN_TOKEN =
''
const folderIds = (
await (
await fetch(`http://localhost:41184/folders?as_tree&token=${JOPLIN_TOKEN}`)
).json()
).items.map((it) => it.id)
const notes = []
for (let i = 1, hasMore = true; hasMore; i++) {
const u = new URL('http://localhost:41184/notes')
u.searchParams.set('page', i)
u.searchParams.set('limit', 100)
u.searchParams.set('fields', ['id', 'title', 'parent_id'])
u.searchParams.set('token', JOPLIN_TOKEN)
const r = await (await fetch(u)).json()
hasMore = r.has_more
notes.push(...r.items)
}
const r = notes.filter((it) => !folderIds.includes(it.parent_id))
console.log('error notes', r) |
@rxliuli Thanks for your help! This time error log reported the exact note with the wrong parent id. After removing the note from Joplin, everything works as before. |
I think it will be better if this extension can handle this kind of error. Joplin can still find the note with wrong parentId without crashing. |
Yes, I will address this issue later. |
Confirmation
The tool/kit where the error occurred
joplin-vscode-plugin
Describe the bug
The search function stopped working.
VS Code:
Version: 1.95.1 (user setup)
Commit: 65edc4939843c90c34d61f4ce11704f09d3e5cb6
Date: 2024-10-31T05:14:54.222Z
Electron: 32.2.1
ElectronBuildId: 10427718
Chromium: 128.0.6613.186
Node.js: 20.18.0
V8: 12.8.374.38-electron.0
OS: Windows_NT x64 10.0.19044
Steps to reproduce the behavior
log file
{"level":"error","message":"command error: joplin.search, Cannot read properties of undefined (reading 'path')"}
Additional context
No response
The text was updated successfully, but these errors were encountered: