Hi,
I’m playing around a simple demo app to understand how conflicts are generated and handled in CBLite & SG. I’m working with CBLite EE 2.7.0 and SG 2.7.1, in SG’s config the databases.foo_db.allow_conflicts
is not set so should default to true.
My app starts creating a new doc like this (logcat output):
Created doc 4f5ad939-c9ea-437e-bd82-9ce5d9684a0c
Doc to string: Document..{4f5ad939-c9ea-437e-bd82-9ce5d9684a0c@1-ed6907ebc6666108a3abd12da2cdf990c9886f27:a=>a,b=>b}
Doc to map to string: {a=a, b=b}
Doc info: 1-ed6907ebc6666108a3abd12da2cdf990c9886f27 - 892
Then I start a push sync and if I try to get the doc via SG api I find it as expected:
{
"_id": "4f5ad939-c9ea-437e-bd82-9ce5d9684a0c",
"_rev": "1-ed6907ebc6666108a3abd12da2cdf990c9886f27",
"_revisions": {
"ids": [
"ed6907ebc6666108a3abd12da2cdf990c9886f27"
],
"start": 1
},
"a": "a",
"b": "b"
}
Then I make a PUT to SG to modify the doc server side, this is the new doc:
{
"_id": "4f5ad939-c9ea-437e-bd82-9ce5d9684a0c",
"_rev": "2-22ea3716b100df98b4de2fc024f5b5e8",
"_revisions": {
"ids": [
"22ea3716b100df98b4de2fc024f5b5e8",
"ed6907ebc6666108a3abd12da2cdf990c9886f27"
],
"start": 2
},
"a": "a",
"b": "server"
}
I also update the doc on the app:
Updated doc 4f5ad939-c9ea-437e-bd82-9ce5d9684a0c
Doc to string: Document..{4f5ad939-c9ea-437e-bd82-9ce5d9684a0c@2-df44bc0ee1c8cd88408c469bae21a8a3c659419e:a=>a,b=>client}
Doc to map to string: {a=a, b=client}
Doc info: 2-df44bc0ee1c8cd88408c469bae21a8a3c659419e - 893
and then start a push sync. Sync performs with no errors, but on the server I can’t find any conflicting revision on the doc, the SG GET payload is exactly the same as above. Even if I perform a pull sync on the app, nothing changes and replication conflict resolver is not fired.
I’d expect to find conflicting revisions in document’s tree server side (how can I inspect them?) and have conflict resolver fired when pull replica is started.
Am I missing something?
Thanks.
Paolo