sboesen / remotely-sync

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

[Bug]: Lengthy fetching metadata times #115

Open kadisonm opened 9 months ago

kadisonm commented 9 months ago

What happened?

From #112.

image

I've noticed that my sync gets stuck on this stage for a long time. On my phone it takes around 2-5 minutes to get past it, then it syncs like normal. While on my computer I left it for around 10 minutes and it didn't work so I gave up.

As @sboesen said it might be the metadata size. I'll try and take a look as well. Resetting the metadata might be a temporary fix.

Would be interested in finding the exact cause of this and seeing if we can fix it.

What OS are you using?

Windows, Android

What remote cloud services are you using?

Dropbox

Version of the plugin

0.4.40

Version of Obsidian

No response

Using password or not

Ensure no sensitive information

kadisonm commented 9 months ago

I wonder if I just have a high amount of deletions in my metadata file. Maybe there is a more efficient way to store deletions? Maybe keeping track of the number of different devices and if all devices have synced a deletion then removing it from the file. Instead of them stacking up.

I believe I downloaded my metadata file from the remote, but I'm not sure how to decrypt it. Encrypted it is 16.2 KB on my computer, which comparing to .md files seems quite big. Not 100% it's my metadata but just doing a sync with no changes, the file is the only one modified on the remote.

kadisonm commented 9 months ago

I had to reset the metadata since it was a personal vault I need for school tomorrow, but I can confirm that syncing works now. I still have the old downloaded copy of the metadata for debugging if it's needed though.

kadisonm commented 8 months ago

@sboesen What would your thoughts be on having an array of devices on the metadata. Each device's plugin can assign itself a new index and add itself to the metadata list.

Then each deletion in the metadata can have the same array but each device has a boolean for if the deletion has been synced on it. Once every device is true, it can remove the deletion from the metadata file.

Hopefully this could keep the sizes down. I can implement this if it sounds good.

sboesen commented 8 months ago

I believe I downloaded my metadata file from the remote, but I'm not sure how to decrypt it.

Yeah this is annoying - opened #129 to make this easier to troubleshoot.

@sboesen What would your thoughts be on having an array of devices on the metadata. Each device's plugin can assign itself a new index and add itself to the metadata list. Then each deletion in the metadata can have the same array but each device has a boolean for if the deletion has been synced on it. Once every device is true, it can remove the deletion from the metadata file. Hopefully this could keep the sizes down. I can implement this if it sounds good.

This does sound good, but if a device is offline or plugin is reinstalled I assume it will create a new "device" and we'll be left with the problem? Just thinking of edge cases. I'm not sure a great way to deal with this myself - what you suggested should work for 80%+ of the time, and I think it would really help!

kadisonm commented 8 months ago

but if a device is offline or plugin is reinstalled I assume it will create a new "device"

Yeh there could be a build up of devices. Could implement a manager in settings and allow users to add a name of their choice to each device. Then allow the option of just removing devices.

I wonder if the plugin has access to the device name? Like "iPhone 11" etc and could assign that name by default.

sboesen commented 8 months ago

That's a great idea! We could possibly auto prune devices which haven't synced in N days, say 60. Worst case people have extra deleted files on devices they don't use much.