What doesn't this conflict mean?

30 views
Skip to first unread message

Nick Pomfret

unread,
May 19, 2016, 5:42:29 AM5/19/16
to Couchbase Mobile

I've got this conflict:



What does it mean to have a conflicting revision that's the same as the document revision? 

Alexander Selling

unread,
May 19, 2016, 11:45:43 AM5/19/16
to Couchbase Mobile
Perhaps you're referring to this:


 

/** Returns all the current conflicting revisions of the document. If the document is not

    in conflict, only the single current revision will be returned. */


- (nullable CBLArrayOf(CBLRevision*)*) getConflictingRevisions: (NSError**)outError;

Nick Pomfret

unread,
May 19, 2016, 12:41:07 PM5/19/16
to Couchbase Mobile
So do I only get this conflict occasionally?  The description in your reply suggests that there should always be one value in the conflicts.

Jens Alfke

unread,
May 19, 2016, 2:15:28 PM5/19/16
to mobile-c...@googlegroups.com

On May 19, 2016, at 9:41 AM, Nick Pomfret <npom...@gmail.com> wrote:

So do I only get this conflict occasionally?  The description in your reply suggests that there should always be one value in the conflicts.

You’re not giving enough information. Where in your code are you seeing this _conflicts property? And how often does it occur?

—Jens

Nick Pomfret

unread,
May 19, 2016, 2:35:58 PM5/19/16
to mobile-c...@googlegroups.com
I have a view that shows me all the conflicts in the system (because there doesn't seem to be any other way to get them):

if(doc._conflicts) {
emit(doc._conflicts, doc);
}

That view contained the document in the screen shot.  It happens occasionally, but I haven't spotted what causes it yet.

--
You received this message because you are subscribed to a topic in the Google Groups "Couchbase Mobile" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mobile-couchbase/6b85pbA0Ess/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mobile-couchba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/782AF3F3-C34B-4803-878A-47602C7B54F1%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.

Jens Alfke

unread,
May 19, 2016, 2:46:23 PM5/19/16
to mobile-c...@googlegroups.com

On May 19, 2016, at 11:35 AM, Nick Pomfret <npom...@snowmonkey.co.uk> wrote:

I have a view that shows me all the conflicts in the system (because there doesn't seem to be any other way to get them):

What implementation of CBL are you using, on which OS?
And your map function looks like JS; does that mean you’re using the REST API in Cordova?

—Jens

Nick Pomfret

unread,
May 19, 2016, 3:41:32 PM5/19/16
to mobile-c...@googlegroups.com
I'm using the rest api in a react-native app.  It happened on IOS, version 1.2.1

--
You received this message because you are subscribed to a topic in the Google Groups "Couchbase Mobile" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mobile-couchbase/6b85pbA0Ess/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mobile-couchba...@googlegroups.com.

Jens Alfke

unread,
May 19, 2016, 4:16:07 PM5/19/16
to mobile-c...@googlegroups.com
This looks like an edge case in the view indexing code for SQLite, where it’s putting the wrong revID in the _conflicts property. I’ll file an issue for it.

What you can do instead is query /db/_all_docs?only_conflicts=true, which will only return documents in conflict. It will also include a _conflicts property, but the logic that generates it is different (and simpler) and should work reliably.

—Jens

Jens Alfke

unread,
May 19, 2016, 4:22:43 PM5/19/16
to mobile-c...@googlegroups.com

Nick Pomfret

unread,
May 20, 2016, 5:54:00 AM5/20/16
to mobile-c...@googlegroups.com
Thanks for the reply.  /db/_all_docs?only_conflicts=true didn't work correctly on android or iOS, which is why I created a custom view for it.

—Jens

--
You received this message because you are subscribed to a topic in the Google Groups "Couchbase Mobile" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mobile-couchbase/6b85pbA0Ess/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mobile-couchba...@googlegroups.com.

Jens Alfke

unread,
May 20, 2016, 12:18:25 PM5/20/16
to mobile-c...@googlegroups.com

On May 20, 2016, at 2:53 AM, Nick Pomfret <npom...@snowmonkey.co.uk> wrote:

Thanks for the reply.  /db/_all_docs?only_conflicts=true didn't work correctly on android or iOS, which is why I created a custom view for it.

I don’t see any open bugs about this, at least on iOS; could you report it, please?

—Jens

Nick Pomfret

unread,
Aug 3, 2016, 1:47:07 AM8/3/16
to Couchbase Mobile
Reply all
Reply to author
Forward
0 new messages