kiwix / kiwix-desktop

Kiwix for Windows and GNU/Linux desktops
https://download.kiwix.org/release/kiwix-desktop/
GNU General Public License v3.0
765 stars 100 forks source link

Certain ZIM files appearing in a monitored directory while kiwix-desktop is running are not added to the library #1151

Closed veloman-yunkan closed 3 months ago

veloman-yunkan commented 3 months ago

alpinelinux_en_all_nopic_2023-01.zim ZIM file is not automatically added to the library when it appears in a monitored directory while kiwix-desktop is running, but is added when kiwix-desktop is restarted.

veloman-yunkan commented 3 months ago

Debugging results:

The testing was performed with monitored directory located on a slow USB stick. The new file was sent to the monitored directory via cp. It looks like the reported issue is caused by a too early attempt to add the new file to the library - at a time when it is still in the process of being copied and is thus is not yet a valid ZIM file. Introducing a small delay in the handler of the directory update events (ContentManager::updateDirectoryFromDir()) eliminates the bug. However, with a larger ZIM file the issue should persist.

Thus it turns out that this ticket is a duplicate of #1150.