My team is creating an offline app using pouchDB as our client database and Couchbase as our main. Currently, we're facing an issue where we occasionally run into 409 conflicts during our syncing (using pouchDB.sync function). Its the general scenario where a device goes offline, updates a document, that same document was updated elsewhere, then we get the conflict when coming back online. We catch the error using the on('error') eventing handler for the sync function, but we're unsure of where to go from there. I've read the PouchDB documentation and it states if we pass the {conflicts: true} flag as an option to our .get() methods, we should see the conflicting revs. However, when we do this we don't see any conflicts on either pouchDB or in couchbase. Does anyone have experience with this issue or have any suggested solutions? Thanks in advance.
We read in the documentation that PouchDB has a built-in algorithm for determining winning revs during conflicts, however our sync process just fails due to the 409 error with subsequent re-tries also failing the same way. We expected the sync not to fail due to this, but rather succeed and allow us to resolve the conflicts afterwards. As previously mentioned though, the document in question doesn't return the _conflicts array when {conflicts: true} is passed to get() and put().