Right, there are a few issues with polling every 500ms like this plugin is doing:
Each /events call is a slow IPC call, and it requires reading the database, which can end up locking it. It's going to slow down the whole app since everything will be waiting for the plugin to be done.
It's going to consume a lot of resources, CPU and memory, and will drain the laptop battery, even when the user is not using the app.
As you don't wait for the application to respond before making the next call, you can potentially have thousands of simultaneous calls waiting for each others (and for sure it's happening for some users).
If you need to know in real time about changes, the onNoteChange or onNoteResource change events are indeed the way to go. If for some reason you need to poll /events, you should try to do it as infrequently as possible - once a minute maybe, or even once an hour if you can, and rely on the onSomething events for real time stuff.
@laurent The original version of Repeating To-Dos used onNoteChange for real time updates. The problem was that the onNoteChange only worked for the currently opened note. The event didn't trigger for any other note. That was why you implemented the /events endpoint in the first place.
Would you be willing to expand the onNoteChange to work with all notes instead of just the active note as I originally requested? It seems to be the only real time updating solution with the /events endpoint being too slow for this functionality
For the time being, i will implement both the onNoteChanged event handler as well as increasing the poll time for the /events endpoint loop. Hopefully that covers all the bases
@laurent A suggestion for a better alternative to onNoteChange.
What if there was a new joplin plugin method: onEvent, that would call the given callback whenever any changes took place no matter what. (note updates, tag updates, notebook updates, alarms, etc.)
As the callback function, the plugin could poll the /events endpoint to see the details of the specific change. This new method would solve the issues of needing real time updates, without unnecessarily frequent polling of the /events endpoint and without making onNoteChange overly complicated.
I might have spotted a problem with this plug-in; could someone else perhaps check this?
I use the plug-in on and off, and had a notebook containing todos that had both a due date and a recurrence set. I then deleted the notebook with its tasks and uninstalled the plugin.
But apparently these (deleted) tasks are kept in some place that is not notified that the tasks are gone and the plug-in no longer installed, because I keep getting reminders about these no longer existing tasks in the android app.
First, let me say that this is the feature that I was looking for in a ToDo list, and I'm grateful for your work!
That said...
I suggest you update your "Links" section at the top of this post to change "Source Code" to read "Source Code and Documentation". It took a while for me (and probably others) to find the documentation
This one is major: I followed the instructions to set repeating ToDos, and nothing happens! After re-starting Joplin, I created a notebook. I created three tasks. I then went back to task 1 and set a recurrence of every minute, repeating up to 3 times, then clicked "Done". I went to the 2nd task, set a recurrence of every minute, repeating 3 times, did not check done. The third task is my "control" and I did nothing. After waiting way longer than 10 minutes, nothing has changed. Task 1 is still checked, task 2 and 3 are still waiting to be done. What did I do wrong? I did "Update all recurrence information" and "Update overdue todos", but still nothing.
Recommend your documentation contains dedicated section to the Tools -> Repeating Todos options, to explain what they are and when to use them.
Would be great to see this built into Joplin, that way it will be fully supported, work on all platforms and less likely on having the functionality break with Joplin updates.
Hey guys, I have some unfortunate news: I'm no longer able to maintain repeating todos as I've moved away from Joplin to using other apps.
Apart from joplin's performance issues (slow load and response times, slow sync times, constant freezes, huge amounts of RAM use, huge amounts of storage use) and almost unusable mobile app, joplin is simply not designed for anything more than storing notes and the most basic of todo lists. It was never really designed to be a to-do system. No matter how many features i try to put into the plugins, they wont change the fundamental core of how joplin works.
In addition, between work and university, i've been struggling to find the time to maintain code for all my projects, including these joplin plugins.
So, unfortunately, I'm giving up my code. If anyone is willing to maintain it, you can go ahead and fork it and continue working on it. But as of now, the versions that are published currently will be the last. Sorry guys
To make it easier for future developers ive moved the Repeating Todos repository back to Github since thats what most developers and Joplin uses. The link is here