This is reproducible with tests/test_nxdrive_903.py.
Identified problem:
The EngineDAO has the update_local_state() and the update_remote_state() method used by the local and remote watcher respectively. These methods can both modify the local_state, remote_state and pair_state of a document.
Let’s say that the folder Folder1 has been renamed to Folder1-renamed remotely, the remote watcher will change its remote_state to modified.
If the local watcher is handling a file File1 which is located in this folder, it will update the last_local_updated of its parent folder. When it started handling this file, the parent was seen as synchronized. In the update_local_modification_time() method, it will call update_local_state() and overwrite the remote_state to synchronized.
Once the processor is called on Folder1, it sees the local_state and remote_state as synchronized and doesn’t perform the renaming event.
Solution:
Modify the update_local_modification_time() so that only the last_local_updated is updated in the Folder1 entry.
Further work:
We need a better isolation between the local and the remote watcher, to ensure no change is overwritten and unprocessed.
- is related to
-
NXDRIVE-903 Renaming folders/files does not sync while network interface is OFF
- Resolved