[Bug]: Note name clashes and loss of data
Confirmation
- [X] I checked FAQ
The tool/kit where the error occurred
joplin-vscode-plugin
Describe the bug
I will describe a couple of bugs relating to a likely similar cause.
name clash issue:
When a note shares the same name a clash can occur which stops the user from changing between two identically named notes.
Missing data issue:
Another issue I have observed which relates the the temporary file naming used. This resulted in actual lost data due to the data not being synced.
Steps to reproduce the behavior
Overwritten data issue:
- open
notes.mdfound in folderfolder1 - open
notes.mdfound in folderfolder2
I am unable to change back to folder1/notes.md and I can only edit folder2/notes.md
Missing data issue:
- open
notes.mdin vscode window - in vscode pallet
Developer: Reload Window - add changes to
notes.md - observe that no changes are made to the original file as synced to the joplin app.
I was fortunate that vscode has local history and I was able to restore the version using vscode functionality.
log file
Additional context
No response
This question is a bit complicated and involves several issues
- Unable to determine when the vscode extension was run for the first time, if you know, you can clear the temporary file directory
- The vscode extension seems to have multiple processes when multiple windows are open, I'm not sure how to share data between multiple windows
An idea is to start a local server so that there is only one instance of map. Record it here first, maybe I'll have time to implement it at the end of the week
This just happened to me!
In you don't have vscode local history, you can just use joplin's note history feature which is native to joplin.

Hi. Why are we looking for item.title on this line (see image) when the shape of GlobalContext.openNoteMap doesn't have item.title as its property?

I tested adding the full note path instead of just item.title and this issue (overriding notes with the same name) was fixed for me.
...
GlobalContext.openNoteMap.get(<... the full note path>)
...
I'm still familiarizing with the source code of this project so I cannot really say if this is intentional.
Hi. Why are we looking for
item.titleon this line (see image) when the shape ofGlobalContext.openNoteMapdoesn't haveitem.titleas its property?
I tested adding the full note path instead of just
item.titleand this issue (overriding notes with the same name) was fixed for me.... GlobalContext.openNoteMap.get(<... the full note path>) ...I'm still familiarizing with the source code of this project so I cannot really say if this is intentional.
Sorry, this looks like a bug, would you like to make a simple PR?
Hi. Why are we looking for
item.titleon this line (see image) when the shape ofGlobalContext.openNoteMapdoesn't haveitem.titleas its property?I tested adding the full note path instead of just
item.titleand this issue (overriding notes with the same name) was fixed for me.... GlobalContext.openNoteMap.get(<... the full note path>) ...I'm still familiarizing with the source code of this project so I cannot really say if this is intentional.
Sorry, this looks like a bug, would you like to make a simple PR?
Of course, I would! I don't even know how to do it, but I would look into it.
If you can guide me somehow in the process it would be very appreciate! 👍👍
Thanks!
Of course, I would! I don't even know how to do it, but I would look into it.
If you can guide me somehow in the process it would be very appreciate! 👍👍
Thanks!
Simply put, it is to first calculate a tempNotePath, and then determine whether it already exists, if so, add the item.id to recalculate
Of course, I would! I don't even know how to do it, but I would look into it. If you can guide me somehow in the process it would be very appreciate! 👍👍 Thanks!
Simply put, it is to first calculate a
tempNotePath, and then determine whether it already exists, if so, add theitem.idto recalculate
Jajaja thanks but I was talking about the PR! I would look a tutorial on how to do it.
Thanks!
released 1.0.1, ref: https://github.com/rxliuli/joplin-utils/releases/tag/joplin-vscode-plugin%401.0.1