First of all, my testing environment:
Sync Gateway 1.4.1
Couchbase Server 4.6.2
Couchbase-Lite Android 1.4.1
Scenario:
Android is creating a document and updating it within 2-3 second which results to 2nd revision and after 4-6 second android get 1st revision in changes field (when debugged i found the source is sync gateway). On server, we stopped listening the changes
Example:
13:18:21.074 _rev=1-5a2e4bb3a3ec7d6f2753eace744f62f2, _id=C-becf8f48-eae2-4337-a70f-d4d1c16f7eb8, eptime=1521445701050 - in changes source is null
13:18:22.564 _rev=2-48d3f1791920eabadc66a1cd1dab5bbb, _id=C-becf8f48-eae2-4337-a70f-d4d1c16f7eb8, eptime=1521445702560 - in changes source is null
13:18:26.914 _rev=1-bddbe7c4537f956d53b04c8bf5731125, _id=C-becf8f48-eae2-4337-a70f-d4d1c16f7eb8, eptime=1521445701050 - in changes source is sync gateway
but strange thing is that _rev=1-5a2e4b… and _rev=1-bddbe7c… have the exact same data even the eptime
final doc->
{
“_sync”: {
“rev”: “2-48d3f1791920eabadc66a1cd1dab5bbb”,
“new_rev”: “1-bddbe7c4537f956d53b04c8bf5731125”,
“flags”: 28,
“sequence”: 2254886,
“recent_sequences”: [
2254880,
2254883,
2254886
],
“history”: {
“revs”: [
“1-5a2e4bb3a3ec7d6f2753eace744f62f2”,
“2-48d3f1791920eabadc66a1cd1dab5bbb”,
“1-bddbe7c4537f956d53b04c8bf5731125”
],
“parents”: [
-1,
0,
-1
],
“bodymap”: {
“2”: “{“eptime”:“1521445701050”}”
},
}
when creating and updating document in offline mode on android no such condition occurs.