Hello, I have question regarding the detection of updates from a plugin. Ideally, I would like to track notes, notebooks and tag updates.
At first, I have used the joplin.workspace.api
We can divide between sync updates and user updates. User updates will happen through the editor so I can use onNoteChange to tell me the about addition and update of the current note.
But there is no mechanism to tell me about deletion. Not only onNoteChange do not trigger delete events,
but a user could delete a note that is not selected.
So the only solution left is to use the joplin.data.api and poll /events at intervals.
However the difficulty here is that changes are recorded from a certain points in time.
Each time the plugin starts, I could request all the most recent data, but I don't find a way to tell
Joplin to track events from a certain point in time (that I would need to collect from another response anyhow).
I can only replay all events stored in the changes table, or even abuse the plugin settings system to persist a cursor value. Even then, data would be replayed from this point only, and we will also have to check that the cursor is still valid.
And of course, we have to poll the state rather than getting notifications which introduce some arbitrary decisions on the plugin data refresh rate.
I would think many plugins would have similar need. Is there a workaround I have overlooked? Is anybody actively using this API? I have noticed it is quite recent since I had to update joplin to use it.
I would appreciate if anyone can share some insight on this.