JackGruber / joplin-plugin-hotfolder

A plugin to Monitor a locale folder and import the files as a new note.
46 stars 4 forks source link

Files that are in the hotfolder when Joplin is not running are not imported correctly #19

Closed dasrecht closed 3 months ago

dasrecht commented 2 years ago

Hi there,

I've run into a weird issue that I didn't find the root cause so far.

Steps to reproduce:

What is seen in the logs is the following:

2021-12-22 11:15:38: "Request (1640168138602): Downloading images: 0"
2021-12-22 11:15:38: "Request (1640168138602): Creating resources from paths: 0"
2021-12-22 11:15:38: "Request (1640168138602): Saving note..."
2021-12-22 11:15:38: "Request (1640168138602): Created note 27f5d949778f4df88fa9f11797082092"

Which looks like a correct and good import. Later when I try to select the note I get the following in the Logs

2021-12-22 11:16:05: "ResourceService::indexNoteResources: A change was recorded for a note that has been deleted: 27f5d949778f4df88fa9f11797082092"

When Joplin is running there's no issue with importing, just everything that was in the hotfolder before Joplin is running somehow gets wiped out.

JackGruber commented 2 years ago

I can't reproduce both behaviors. Witch JOplin and Plugin version do you use and on witch OS?

dasrecht commented 2 years ago

Currently - Joplin 2.6.10 on macOS Monterey 12.1

Tried a few things - Disabled all plugins and broke the Sync to Joplin Cloud but no luck. The files that are created when Joplin isn't running show up in the view but aren't really selectable.

The dev-console log seems to show the same. The only thing I could see is that the plugin imports too early before joplin is really able to process the new note but that's a bit outside of what I know about the plugin system.

If it works for others I might be the odd one out - feel free to close it

20:50:49: Request (1640202648959): Created note 232f1846e5b644339fbe80bbf522cadc
Uncaught (in promise) Error: Cannot find note with ID: 232f1846e5b644339fbe80bbf522cadc
20:51:15: ResourceService::indexNoteResources: A change was recorded for a note that has been deleted: 232f1846e5b644339fbe80bbf522cadc
JackGruber commented 3 months ago

Version 1.2.0 contains many optimizations that may solve this problem and a logging option for better error analysis.