stravo1 / obsidian-gdrive-sync

sync notes across devices in Obsidian via Google Drive
441 stars 10 forks source link

Download updated files not working. #21

Open landoskape opened 4 months ago

landoskape commented 4 months ago

First, thank you for this amazing plugin. Really beautiful work.

I have the sync plugin working between my windows PC and my phone. (I uploaded everything to Drive by initializing it on the PC, then I added the plugin to my phone and it successfully downloaded everything).

Both devices successfully upload files that are changed. I checked the files in google drive, and can see the updates.

However, neither device is downloading files that have been updated. Why? Do I have to do this manually? Let me know what to do. Thanks.

stravo1 commented 4 months ago

thank you :)

i published a new release a few minutes back (v0.9.9-beta-8) in which the entire sync process has been revamped, please do try the latest release and report any issues that you face.

and to answer your queries: if you edit any note on one device and then open it on any other device, it should get updated automatically with the latest content, no manual intervention is needed. the plug-in compares the "lastSync" property/tag of the note between the local file and the one stored in Drive and updates the one with the latest changes.

please do keep in mind that non ".md" files (non-note files), like images, audio files etc. are uploaded only once, if the image or audio file is changed that change is not reflected, you need to manually upload and download them. for that there's commands available "Upload current file to Google Drive" and "Download current file from Google Drive" in the command panel. im currently working on the attachment sync process to make it more streamlined :)

rodrigo1806 commented 4 months ago

Thanks for the project @stravo1 . Just to understand. After the update, should the files be updated even without opening them in Obsidian? Or is there still a need to open each updated file for the drive update to be applied?

stravo1 commented 4 months ago

the note which has been updated on one device needs to be opened in other devices to get the latest content. notes are synced only if they are currently open in the editor.

to auto update all the files without even opening them would require downloading and checking the contents of each file and comparing them with the local content, that would greatly increase the data and CPU usage, especially for huge vaults with thousands of notes. so only the note being opened, i.e., the note which is important right now is synced properly.

however any note/attachment which was deleted, renamed, or created on one device is also automatically deleted, renamed or created on other devices without the need to open that note/attachment, opening the vault is enough.

tldr: creation, deletion and renames are synced automatically even without opening the files on which these actions were made, however if the contents of a note is changed on one device, it needs to be opened on other devices to reflect that change :)