MobileSheets Forums

Full Version: Two-Way Sync doesn't ever delete files, and re-creates deleted files?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi. I've just finally realized why I keep thinking "Huh, I thought I deleted that...", and I'm wondering if this is by design or a bug or something else.

Here's what I'm doing:
* Add a song.
* Sync. Two-way. Cloud folder (Google Drive).
* Delete a song.
* Sync. Two-way again.

What I'd expect: The deleted song to stay deleted (and to delete on the cloud folder).

What happens: The deleted song gets recreated.

I can work around this by making the sync update the folder and having the "delete" checkbox checked. But I'd expect a two-way sync to respect deletions. Is that not the case?

Thanks for any tips, tricks, or info Smile
A two-way sync wil never delete anything, because that would be a dangerous thing to do. Furthermore, there is no way for MobileSheetsPro to know which is newer - the song present on the cloud or the song that was deleted. From the perspective of the code, it doesn't know that you just deleted that song (nothing is saved in the app about deleted objects). It just encounters a song it knows nothing about on the cloud, and so the two-way sync goes, "okay, that's new, I should create it". If you want to delete a song and have that song be deleted from the library on the cloud, change the sync type to "Update Folder". Then you will see a checkbox appears to enable the deletion of songs (I know you figured this out, I just wanted to mention it for others in case they missed it). This is the only way to ensure that deletions are safe and intended. This is even more important when synchronizing two devices together. 

For a more complex example, consider when five different people are all synchronizing to the same cloud folder. If one person just added a song to the cloud folder that doesn't exist on everyone elses devices, and they sync to the cloud, it shouldn't delete that song on the cloud. It would need to be created on each device. While this logically is obvious when you think about it in terms of knowing the history and context, the code doesn't know any of that. It has to consider decisions based on the information it has. Unless I started tracking the history of every action that is taken (including deletions of songs), it would be impossible to know when deleting is the right action versus adding. 

As a side note, you can still use the two-way sync if you want. Just change the merge behavior to "Prompt user for decision". You can then say you want to delete the song when prompted.

Hopefully this makes sense. If not, I can explain more.

Thanks for the thorough response. It makes sense. I hadn't caught the "prompt user for decision", so that sounds like what I'll want to do.

I think this is really the crux of it, for my understanding at least:
nothing is saved in the app about deleted objects

I think I (and probably others) would assume Dropbox-like behavior, where a local deletion deletes it from the cloud (which syncs with other devices so it's triggers local deletions). I realize that's not easy, though, and without tracking deletions in the app, the current behavior definitely makes the most sense.

Thanks, as always, for the great app and support Smile