hamster-service does not refresh upon file synchronization
Created by: ederag
Synchronizing the hamster.db
with unison
does not work since v2.0-rc1.
Even if the file is changed, the overview or command-line src/hamster-cli list
still display the old state.
The issue is that hamster is monitoring changes or creation https://github.com/projecthamster/hamster/blob/5771c287aa5e998efaa85766c5fa08f61866f545/src/hamster/storage/db.py#L84-L85
while unison
does not change the file in-place, but instead
first transfers the file under a temporary name, and then atomically moves it to the final name.
hamster.storage.db - DEBUG - <enum G_FILE_MONITOR_EVENT_MOVED of type Gio.FileMonitorEvent>
SEND_MOVED
is deprecated, so it would be tempting to use the recommended WATCH_MOVES
, but it does not help:
hamster.storage.db - DEBUG - <enum G_FILE_MONITOR_EVENT_RENAMED of type Gio.FileMonitorEvent>
Better remove the flag altogether ?