Force a conflict in Couchbase Lite

Hey all,

I’m building unit tests into my Android app that uses Couchbase Lite, and want a way to effectively test my conflict resolution code. I know it’s fairly straightforward to force a conflict on Couchbase Server, but I’m not sure how to do it on Couchbase Mobile.

Thanks!

You can create a revision on your document and then call save on that revision using the version of the API call that accepts a bool indicating whether or not to allow conflict. Do this two times on the same revision object and you will have a conflict.

1 Like