vrtmrz / livesync-bridge

44 stars 6 forks source link

Directory Folder rename breaks sync #11

Open wchorski opened 8 months ago

wchorski commented 8 months ago

When renaming a folder, example "developer" -> "Developer Notes" the connection between bridge and Obsidian sync clients seems to come to a halt.

Old directory is re Synce

Also the old directory likes to come back, or doesn't remove itself on the server side "storage" folder. Example, I rename "developer" -> "Developer Notes", but the server side storage folder will now have both "developer" and "Developer Notes" directories.

A later sync even brings back the old "developer" folder into my Obsidian App vault.

Bridge Docker Logs

Looks like when I edit a note I still get activity in Bridge's logs, but going to the Obsidian App running the Self Hosted Live Sync

2/19/2024, 9:18:03 PM   -1  Requesting ... post https://obsidian-db.MYDOMAIN.com/obsidian_db/_all_docs?include_docs=true
2/19/2024, 9:18:03 PM   -1  Chunks retrieved (2 / 2)
2/19/2024, 9:18:03 PM   10  GET: DONE (META): Recently edited.md
2/19/2024, 9:18:03 PM   10  [pywriter] --> New Note.md change detected
2/19/2024, 9:18:03 PM   10  WATCH: PROCESS DONE: New Note.md

Work around

It could be inpatients, but things seem to work after a few docker compose restart on the Bridge app and closing, restarting the Self Hosted Live Sync plugin.

Renaming a Directory

Is there any "best practice" for renaming a folder, especially if it nests many other sub directories so that Bridge and Live Sync behave nicely together? Should I stop the sync, rename file, and rebuild the remote db to match my local db anytime I need to rename a folder?

How should I proceed for my other Obsidian App devices (i.e. mobile)? Do I need to rebuild local from the remote db as well?

vrtmrz commented 8 months ago

Thank you for pointing this out! I did not notice this. We left the change detection to Watcher of Deno, however, it was not able to handle the folder so fluently. So Now it uses chokidar (which is the same as used at FileSystem-LiveSync). I think that it now works fine. Would you mind if I ask you to check the behaviour, please?