Sunday, 24 February 2019

sync - How does Dropbox determine when to overwrite the local file vs overwrite the cloud file?


When Dropbox encounters a file on one's computer that is different than the cloud version of that file that it knows about, how does it decide whether it should sync them by overwriting the local file with the cloud file or sync them by overwriting the cloud file with the local file?


To rephrase:




  • If the server copy and the local copy of a file are different,




  • and if the dropbox program is launched and finishes syncing,




  • then these two files will be the same.




These two files will also be identical to one of the old files. My question is which --- the old server copy or the old local copy? How does it decide?



Answer



I have partial information which begins to answer this question. I'm not sure how useful this is to experienced users, but I know newer users like myself will find this report helpful.


As an aside, working this out makes me even more puzzled how an incredibly basic question doesn't have any official or authoritative answer. The lack of available documentation or discussions tells me that users of Dropbox are fine with taking whatever Dropbox actually does as what they would have expected it to do under those circumstances. (i.e., I wouldn't even say that users have a concrete expectation that they hold dropbox to)


Examples of how Dropbox will behave:


In my examples, computer A and computer B are never both powered on at the same time. Imagine a single user working non-collaboratively at home and work, with each computer being turned off before coming back to the other one.


What happens when one computer's dropbox folder isn't identical to the cloud dropbox folder? For maximum clarity I prefer to imagine how dropbox.exe reacts when one computer has an empty dropbox folder. Will dropbox.exe consider those missing files as "deletions" (which means it will remove them from the cloud dropbox folder) or "out of date" (which means it will create new copies of them inside the local dropbox folder).




  1. Start with situation where the behavior is plainly obvious: Computer A is on and computer B is off. If dropbox.exe is running and changes are made to A, then these are propagated to the cloud folder and not vice versa. So at the moment, if A's folder is emptied, then these missing files/folders are considered "deletions" and the cloud folder is emptied.




  2. Suppose B has an empty dropbox folder, and A creates files and sync these to the cloud dropbox folder. If we switch to computer B, the situation is that dropbox.exe will interpret B's empty dropbox folder as "out of date", and new copies from the cloud folder are created on B.




  3. Now for the less obvious: Suppose we make some changes in B and sync these changes to the cloud dropbox folder. If we switch to computer A and --- without first running dropbox.exe --- we delete things inside A's dropbox folder, what will running dropbox.exe afterwards do? In this situation dropbox.exe will interpret the missing files/folders as new deletions that should be propagated to the cloud dropbox folder.




I find it confusing that in situations 2 and 3 you have dropbox.exe being turned on and encountering the same "fresh" state on a new computer that differs from the cloud folder, but it will act differently.


If you wanted to invent a rule that explains how dropbox.exe operates, you evidently cannot assume it is a function of the three variables: (1) what it sees on the computer right now, (2) what it sees on cloud folder, and (3) which computer was last to sync with the cloud folder. (!!!)


Perhaps the extra variable is that Dropbox remembers what each computer last sync'ed to the cloud folder. In situation 2, we might assume the last time computer B sync'ed, it sync'ed an empty folder. In situation 3, Dropbox remembers that the last time computer A sync'ed, it sync'ed a folder that was different than what it presently finds inside the folder.


No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...