So just doing some more stepping through the debugger to try and figure out
what's going on.
Before my loop, the array of conflicts from the document is as follows now:
*(lldb) po conflicts*
<__NSArrayI 0x610000020720>(
CBLSavedRevision[rec-..fb1b/1-4098dccaa969cdbab64825e687aaec68],
CBLSavedRevision[rec-..fb1b/4256-205cb128a6a5dfd1928ee4a6d38aa1f9]
)
then after I mark the revision as being deleted and I print out the list of
conflicts again on my doc:
*(lldb) po [doc getConflictingRevisions:nil]*
<__NSArrayI 0x608000024160>(
CBLSavedRevision[rec-..fb1b/4256-205cb128a6a5dfd1928ee4a6d38aa1f9]
)
So now there's just one in the list as it looks like the 1- revision is
gone.
However, when I look at the CBLSavedRevision for the deletion, it has a
revisionID prefix of 2:
CBLSavedRevision[rec-..fb1b/2-a106816d32bc283bc24acf98abeeec2d]
Now when the loop gets to the revision that's to be merged and then saves
it, it now has the revision:
CBLSavedRevision[rec-..fb1b/4257-f4359eb63dc53f74a997adc1f606cd73]
So it's one higher now.
And now the document's conflicting revisions has this new revision in the
array:
*(lldb) po [doc getConflictingRevisions:nil]*
<__NSArrayI 0x6080000255a0>(
CBLSavedRevision[rec-..fb1b/4257-f4359eb63dc53f74a997adc1f606cd73]
)
But then I'm back to where I started after the replicator pulls again:
<__NSArrayI 0x610000020860>(
CBLSavedRevision[rec-..fb1b/1-4098dccaa969cdbab64825e687aaec68],
CBLSavedRevision[rec-..fb1b/4257-f4359eb63dc53f74a997adc1f606cd73]
)
Again with the same conflict, but one revision higher now.
I'm not quite sure how to resolve this issue.
The _deleted flag in the revisions properties is definitely getting set
right after the revision's isDeletion flag is set to YES.
*(lldb) po [savedRevison properties]*
{
"_deleted" = 1;
"_id" = "rec-a0ada90ce645458ebdb3ff7259c6fb1b";
"_rev" = "2-a106816d32bc283bc24acf98abeeec2d";
dateCreated = "2016-04-12T05:07:38.866Z";
dateModified = "2016-04-12T05:07:38.866Z";
dbID = "db-1deccd0e15dc4047ab96eba344144f3b";
form = "frm-19f6c15c8f7f45c5a586d99685549697";
type = "frm-19f6c15c8f7f45c5a586d99685549697";
values = {
"fld-08c6bd02523b41899614960ddd45bee6" = Fawcett;
.... lots of other values here I removed for this post ....
};
}
And then the merged revision looks like this:
*(lldb) po [savedRevison properties]*
{
"_id" = "rec-a0ada90ce645458ebdb3ff7259c6fb1b";
"_rev" = "4257-f4359eb63dc53f74a997adc1f606cd73";
dateCreated = "2016-04-12T05:07:38.866Z";
dateModified = "2016-04-14T18:56:25.522Z";
dbID = "db-1deccd0e15dc4047ab96eba344144f3b";
form = "frm-19f6c15c8f7f45c5a586d99685549697";
type = "frm-19f6c15c8f7f45c5a586d99685549697";
values = {
};
}
The one with the empty "values" property is the most recent edit as I had
deleted the values from the document, so 'values' should be empty. But the
conflicted revision still has all the values.
Hopefully this more information can help shed some light on the situation.
Thanks,
Brendan
On Thursday, April 14, 2016 at 2:43:02 PM UTC-6, Jens Alfke wrote:
>
>
> On Apr 14, 2016, at 1:19 PM, Brendan Duddridge <[email protected]
> <javascript:>> wrote:
>
> CBLSavedRevision[rec-..fb1b/1-4098dccaa969cdbab64825e687aaec68],
>
> CBLSavedRevision[rec-..fb1b/4206-5128082a4eb2783ba5e60116f84f7e07]
>
> But each time through the above loop, a new revision is being added, so
> 4206 becomes 4207, ... n. and so on.
>
>
> So the 1-409… revision isn’t being deleted? The code in your previous
> message should end up deleting it. Have you tried stepping through it to
> see what’s going on?
>
> —Jens
>
--
You received this message because you are subscribed to the Google Groups
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/mobile-couchbase/596259db-92c3-4e78-bceb-b61288909ce0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.