Skip to content
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

Perpetually generating tags #7

Open
yodahome opened this issue Feb 19, 2021 · 8 comments
Open

Perpetually generating tags #7

yodahome opened this issue Feb 19, 2021 · 8 comments

Comments

@yodahome
Copy link

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.

@rubbsdecvik
Copy link

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?

@g33k247
Copy link

g33k247 commented Feb 21, 2021

Likewise and my notes are not encrypted. Standard installation (except for this plugin) and using MS OneNote for syncing.

2021-02-21_10-54-26

Also see this JS error thrown when exiting:

image

@g33k247
Copy link

g33k247 commented May 18, 2021

Has there been any traction on this issue? I'm seeing this on both Linux and Windows clients now!

@shkarlsson
Copy link

shkarlsson commented May 19, 2021

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).

@Samuel-Villegas
Copy link

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

@g33k247
Copy link

g33k247 commented Jan 14, 2022

@Samuel-Villegas where are you making the changes you outlined?

@Samuel-Villegas
Copy link

@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?

@g33k247
Copy link

g33k247 commented Mar 25, 2023

When is this plugin gonna be fixed?

laurent22 added a commit to joplin/plugins that referenced this issue Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants