Files
koreader/plugins
Tomáš Janoušek 6a371263b8 Wallabag: skip archive/delete if it's the currently opened document (#15961)
Moving (or deleting) the file while it's still being open in the reader
causes problems: its metadata will be written to the old location when
it's eventually closed, and I think I've seen crashes as well (don't
quite remember but something like switching to File Browser and then
using the Open Last Book function or something).

The simplest solution is to just not archive it while it's still open.
It will be archived on the next sync anyway.

Alternatively, we could do what movetoarchive.koplugin does, and ask the
user whether they want to open it from the new location (if archiving)
or switch back to File Browser:
https://github.com/koreader/koreader/blob/8c4d6c0a3ab8449ac65b413187d27d54f50fd946/plugins/movetoarchive.koplugin/main.lua#L153-L161
I don't think it's worth the complexity though — Move to Archive doing
nothing is bad UX, obviously, but a Wallabag sync skipping one article
until the next sync is fine, IMO.

I suspect this might also be related to this TODO note:
https://github.com/koreader/koreader/blob/8c4d6c0a3ab8449ac65b413187d27d54f50fd946/plugins/wallabag.koplugin/main.lua#L1428
2026-08-28 18:47:00 +02:00
..