{"action":"opened","issue":{"url":"https://api.github.com/repos/cloudant/sync-android/issues/175","labels_url":"https://api.github.com/repos/cloudant/sync-android/issues/175/labels{/name}","comments_url":"https://api.github.com/repos/cloudant/sync-android/issues/175/comments","events_url":"https://api.github.com/repos/cloudant/sync-android/issues/175/events","html_url":"https://github.com/cloudant/sync-android/issues/175","id":90690502,"number":175,"title":"_rev id creation is non-deterministic","user":{"login":"Matulis","id":1459859,"avatar_url":"https://avatars.githubusercontent.com/u/1459859?v=3","gravatar_id":"","url":"https://api.github.com/users/Matulis","html_url":"https://github.com/Matulis","followers_url":"https://api.github.com/users/Matulis/followers","following_url":"https://api.github.com/users/Matulis/following{/other_user}","gists_url":"https://api.github.com/users/Matulis/gists{/gist_id}","starred_url":"https://api.github.com/users/Matulis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Matulis/subscriptions","organizations_url":"https://api.github.com/users/Matulis/orgs","repos_url":"https://api.github.com/users/Matulis/repos","events_url":"https://api.github.com/users/Matulis/events{/privacy}","received_events_url":"https://api.github.com/users/Matulis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-24T14:22:04Z","updated_at":"2015-06-24T14:22:04Z","closed_at":null,"body":"I've run into the issue in a continuously replicating database in which a conflict rises and then the clients create a new revision deterministically when they detect the conflict. Each client hypothetically makes the same changes to the document in conflict, however each version results in a different _rev tag. This can lead to a ping-ponging of changes between clients without ever coming to a convergence. \r\n\r\nAccording to the CouchDB docs, this _rev should be deterministic(md5-hash of JSON body, attachments, _deleted flag):\r\nhttp://guide.couchdb.org/draft/conflicts.html#deterministic\r\n\r\nI have tested a simple version in which I only consider the md5 hash of the body and the _deleted value, and it seems to have fixed the issue for me. I think if the original algorithm from erlang can be ported and verified then it would be ideal for compatibility with other clients."}}