joplin-tags-generator
joplin-tags-generator copied to clipboard
Perpetually generating tags
I have installed the plugin via Joplin on version 1.7.11 (prod, win32). When I right-click on any note and choose "generate tags" it shows me the rotating circle "Please wait, tags generation is in progress" and it does not stop. I have to kill Joplin and restart to be able to do anything, tags have not been generated. My notes are encrypted and synced via Nextcloud, I use the German translation. I have tried four or five different notes of varying length. Not sure what is going on there. I also have the CodeMirror Line Numbers and the Inline Tags plugin installed. However I also tested it on macOS 11 with no other plugins and do get the same behaviour.
I am running into the same issue. Unfortunately, nothing new emits to the debug console when I try it with the --debug
flag. Is there some other way to help gather troubleshooting information?
Likewise and my notes are not encrypted. Standard installation (except for this plugin) and using MS OneNote for syncing.
Also see this JS error thrown when exiting:
Has there been any traction on this issue? I'm seeing this on both Linux and Windows clients now!
This happens for me too, on a Mac, synced with DropBox. Version 1.8.5. It doesn't completely lock the app though. I can shortcut to Options after which the generating window is gone and I'm back at the note (no tags generated).
It looks like this plugin is getting stuck in an infinite loop when it enters the while (!!response.has_more)
section of function getAll(api, path, query)
in src/index.ts
.
From what I can tell, it looks like response
is getting re-declared within the scope of the while loop, so instead of continuing to read more responses into the first response
variable, the successive responses are getting read into the second response
variable which then goes out of scope unused before the program loops back around to check if the first response
variable has_more
to get
from the api
.
I'm not super familiar with TypeScript or Joplin's plugin API though, so I'm not 100% sure if this is the case. However, removing the second let
seemed to fix the issue for me. Maybe someone with a better understanding of this could double check my detective work?
Optional Safety Measure
Setting an upper limit to the number of pages (if(query.page > PAGE_LIMIT) break;
) also seemed to fix this issue, but my choice for the page limit was somewhat arbitrary. It's quite possible that more than PAGE_LIMIT
responses need to be get
'ed. If a more reasonable upper limit can be chosen, I think having an upper limit may be a good safety measure just in case it does get stuck in a loop again for some reason—possibly accompanied by a warning or error message or some prompt to the user to continue or exit instead of just breaking out of the loop quietly.
Test Configuration
Platform: Linux Joplin Version: 2.0.11 Tags Generator Version: v1.0.0
@Samuel-Villegas where are you making the changes you outlined?
@g33k247 I made the changes in the while (!!response.has_more)
section of function getAll(api, path, query)
in src/index.ts
of this plugin. If I recall, I went through ~/.config/joplin-desktop
to find the files for this plugin and edited its index.ts
there. However, the javascript there has been minified/uglified so I had to search for has_more
to find the right place to make the changes. So, this is very much a messy workaround and not a complete solution.
For reference, here's what the line should look like before:
for(;a.has_more;){i.page+=1;let a=yield N.get(e,i);n.concat(a.items)}
and after adding in if(i.page > 1000) break;
and removing the second let
:
for(;a.has_more;){if(i.page > 1000) break;i.page+=1;a=yield N.get(e,i);n.concat(a.items)}
Again, not really my area of expertise, but hopefully this helps somewhat?
When is this plugin gonna be fixed?