Local document change bounces back as external change after passing through sync_gateway


#1

Hi there,

The sync function in our app starts behaving incorrectly after updating to couchbase-lite-1.3.0 (android) from 1.2.1.

Symptom
While modifying (with single client) a remote document that is synchronized via sync_gateway with both pull/push replicator. There are external change events being reported and required conflict resolution. My impression is local change bounce back as external change sometime but not always. Some other issue we observe: if forest db is enabled, the conflicting revision to resolve has no parent id.

Things we have tried
We have tried a couple things to lock down the issue:

  1. Bump back to couch-base-lite 1.2.1, the issue disappear, the local changes won’t fire external change events.
  2. Set the channel to read only, the issue disappear, which indicates the external change event is not fired from the same local document change in the local database

Unfortunately, we cannot locate the root cause. My impression is somehow the pull replication is not suppressing the originating changes but considering those as external changes and asking for conflict resolution. Please help.

Thanks,

This is part of log from sync-gateway where a external change is observed:

2016-08-31T11:16:06.550-06:00 HTTP: #6815: POST /data/_revs_diff (as userwVVMsI7gXeMt4fQH24YJGikI)
2016-08-31T11:16:06.581-06:00 HTTP: #6816: POST /data/_bulk_docs (as userwVVMsI7gXeMt4fQH24YJGikI)
2016-08-31T11:16:07.039-06:00 HTTP: #6817: POST /data/_revs_diff (as userwVVMsI7gXeMt4fQH24YJGikI)
2016-08-31T11:16:07.081-06:00 HTTP: #6818: POST /data/_bulk_docs (as userwVVMsI7gXeMt4fQH24YJGikI)
2016-08-31T11:16:07.559-06:00 HTTP: #6819: POST /data/_revs_diff (as userwVVMsI7gXeMt4fQH24YJGikI)
2016-08-31T11:16:07.590-06:00 HTTP: #6820: POST /data/_bulk_docs (as userwVVMsI7gXeMt4fQH24YJGikI)
2016-08-31T11:16:08.060-06:00 HTTP: #6821: POST /data/_revs_diff (as userwVVMsI7gXeMt4fQH24YJGikI)
2016-08-31T11:16:08.096-06:00 HTTP: #6822: POST /data/_bulk_docs (as userwVVMsI7gXeMt4fQH24YJGikI)
2016-08-31T11:16:08.460-06:00 HTTP: #6823: POST /data/_changes?feed=longpoll&heartbeat=30000&style=all_docs&since=24333&limit=50 (as userwVVMsI7gXeMt4fQH24YJGikI)
2016-08-31T11:16:08.559-06:00 HTTP: #6824: POST /data/_revs_diff (as userwVVMsI7gXeMt4fQH24YJGikI)
2016-08-31T11:16:08.613-06:00 HTTP: #6825: POST /data/_bulk_docs (as userwVVMsI7gXeMt4fQH24YJGikI)
2016-08-31T11:16:08.959-06:00 HTTP: #6826: POST /data/_bulk_get?revs=true&attachments=true (as userwVVMsI7gXeMt4fQH24YJGikI)
2016-08-31T11:16:09.079-06:00 HTTP: #6827: POST /data/_revs_diff (as userwVVMsI7gXeMt4fQH24YJGikI)
2016-08-31T11:16:09.089-06:00 HTTP: #6828: POST /data/_bulk_docs (as userwVVMsI7gXeMt4fQH24YJGikI)
2016-08-31T11:16:09.819-06:00 HTTP: #6829: POST /data/_revs_diff (as userwVVMsI7gXeMt4fQH24YJGikI)
2016-08-31T11:16:09.859-06:00 HTTP: #6830: POST /data/_bulk_docs (as userwVVMsI7gXeMt4fQH24YJGikI)
2016-08-31T11:16:10.349-06:00 HTTP: #6831: POST /data/_revs_diff (as userwVVMsI7gXeMt4fQH24YJGikI)
2016-08-31T11:16:10.389-06:00 HTTP: #6832: POST /data/_bulk_docs (as userwVVMsI7gXeMt4fQH24YJGikI)
2016-08-31T11:16:10.471-06:00 HTTP: #6833: POST /data/_changes?feed=longpoll&heartbeat=30000&style=all_docs&since=24387&limit=50 (as userwVVMsI7gXeMt4fQH24YJGikI)
2016-08-31T11:16:10.479-06:00 HTTP: #6834: POST /data/_changes?feed=longpoll&heartbeat=30000&style=all_docs&since=24388&limit=50 (as userwVVMsI7gXeMt4fQH24YJGikI)
2016-08-31T11:16:10.969-06:00 HTTP: #6835: POST /data/_bulk_get?revs=true&attachments=true (as userwVVMsI7gXeMt4fQH24YJGikI)
2016-08-31T11:16:10.989-06:00 HTTP: #6836: POST /data/_revs_diff (as userwVVMsI7gXeMt4fQH24YJGikI)
2016-08-31T11:16:11.039-06:00 HTTP: #6837: POST /data/_bulk_docs (as userwVVMsI7gXeMt4fQH24YJGikI)
2016-08-31T11:16:11.630-06:00 HTTP: #6838: POST /data/_revs_diff (as userwVVMsI7gXeMt4fQH24YJGikI)
2016-08-31T11:16:11.739-06:00 HTTP: #6839: POST /data/_bulk_docs (as userwVVMsI7gXeMt4fQH24YJGikI)
2016-08-31T11:16:12.139-06:00 HTTP: #6840: POST /data/_revs_diff (as userwVVMsI7gXeMt4fQH24YJGikI)
2016-08-31T11:16:12.180-06:00 HTTP: #6841: POST /data/_bulk_docs (as userwVVMsI7gXeMt4fQH24YJGikI)
2016-08-31T11:16:12.469-06:00 HTTP: #6842: POST /data/_changes?feed=longpoll&heartbeat=30000&style=all_docs&since=24456&limit=50 (as userwVVMsI7gXeMt4fQH24YJGikI)
2016-08-31T11:16:12.969-06:00 HTTP: #6843: POST /data/_bulk_get?revs=true&attachments=true (as userwVVMsI7gXeMt4fQH24YJGikI)
2016-08-31T11:16:14.229-06:00 HTTP: #6844: PUT /data/_local/29748b430ef6b726ecb31dbb6d20d872bec76f8c (as userwVVMsI7gXeMt4fQH24YJGikI)