Problem on Eventing with syncgateway

When sync gateway is running, if saving a document directly to Couchbase via the web dashboard, the OnUpdate() function is firing twice.

Documents saved through sync gateway results in OnUpdate() firing once.

When I kill sync gateway, saving documents to Couchbase results in OnUpdate() firing once.

Does Exist a workaround for this problem?

Thank you!

If you have enable_shared_bucket_access turned on to have Sync Gateway import SDK writes, the 2 OnUpdate events are expected.

The first being your original SDK write, and the second being Sync Gateway importing that document, stamping necessary metadata, and writing that back to the Couchbase Bucket.

There is a workaround noted here to ignore Sync Gateway updates:

What Ben discussed below has since been covered in our docs -