sboesen / remotely-sync

fork of remotely-save with security upgrades
Apache License 2.0
213 stars 8 forks source link

[Bug]: OneDrive - Syncing new files with no content not uploading #67

Open kadisonm opened 11 months ago

kadisonm commented 11 months ago

What happened?

Adding new files without content shows them syncing in the status bar and the console, but they don't show up on the cloud. Deleting the no content files then syncing shows that it is trying to sync their deletion history "uploadLocalDelHistToRemote" If I sync again after it tries to sync them under "keepRemoteDelHist" and does this every consequent sync.

This could be a OneDrive problem but I haven't tested what services this happens to.

What OS are you using?

Windows

What remote cloud services are you using?

OneDrive for personal

Version of the plugin

0.4.28

Version of Obsidian

1.4.16

Using password or not

Ensure no sensitive information

sboesen commented 11 months ago

Looks like this isn't supported by OneDrive - https://support.microsoft.com/en-us/office/fix-problems-uploading-files-on-the-onedrive-website-9afcc4a0-e344-4bc9-9c9d-59d3e802247e

Screenshot 2023-12-13 at 11 41 37 AM

link talks about the website, but we have code that checks specifically if it's OneDrive + empty file and skips the file.

https://github.com/sboesen/remotely-sync/blob/8e2bbc80a84a861d3376ec072e24c748b334bc5b/src/sync.ts#L1111-L1120

The fix here would be uploading some placeholder text, detecting a file containing just the placeholder, and creating an empty file locally.

This only seems like the case for OneDrive so not the biggest priority right now, but will keep the issue open for tracking

kadisonm commented 11 months ago

Oh interesting, thanks for letting me know. I'm probably going to switch back to Dropbox then but I think you should add a little disclaimer to the settings explaining this as one of the downsides to using OneDrive.

Also maybe a potential work around to this is storing the empty files and folders in the metadata or a similar file. Just to say they exist and then create them locally if they aren't there.

sboesen commented 11 months ago

💯

sboesen commented 11 months ago

Added note in readme