

As a result, we always rely on timestamps to determine which update is newer. In our case, the main problem with doing a two-way merge is that, because we can’t use the server as source of truth, we don’t have a revision history to keep track of which revision is earlier. We realized a three-way merge might help us here, too. Although this client has a more advanced version of conflict handling, the basic principle is the same. In fact, we already use the same idea in the Dropbox desktop client when syncing files between devices. In a three-way merge, the common ancestor and the tips of both branches are used to generate a merged commit. In these cases, there is a common ancestor of both branches, but no branch is an ancestor of the other. Git uses a three-way merge when a user wants to merge two branches but there isn’t a linear path to merge from one branch to another branch. In order to tackle this problem, we borrowed the idea of a three-way merge from Git, the popular source control tool. Here is a diagram illustrating what a failed sync might look like with offset clocks. If the computer’s clock is behind true time-by ten minutes, ten seconds, or even ten years-it’s possible that a more recent change will actually be marked as older. In our example, the phone’s login item trumps the computer’s login item because of this clock skew. This could be the result of a dead CMOS battery, an incorrect time zone setting, or perhaps even malware. It is actually possible for a device’s time to be out of sync with true time. We generally assume that our electronic devices have an accurate representation of the current time, but this is not always the case. Recall that the client is responsible for setting the timestamps on each item. You are shocked to see your initial change-the one you made from your phone-has overwritten the newer change you just made on your laptop. After updating the notes field, you save the item, but something strange has happened.

So you open up your computer to fix your mistake. A few minutes later, you realize that you made a mistake when typing one of the questions-but your phone is all the way across the room. You edit the notes field on one of your login items from your phone so that you can remember those pesky security questions.

You are a happy Dropbox Passwords user with a computer and phone synced to the same account.
