Yes, everything is done in a single database transaction now.  I updated
this PR last week.

I've addressed everything in the code that you brought up -- except that I
went ahead and documented how to use TD* to build a CDTDocumentRevision.
I'll change that back now to instruct the user to use a currently existing
CDTDocumentRevision. So... the user won't be able to create a winner, only
choose an existing revision to choose a winner, correct? (I just want to
make sure since this is obviously limiting). I'll document that we plan to
create a CDTMutableDocumentRevision object. I'll update the PR today right
after I change the documentation.

However - aren't the TD* already exposed and available to the developer
that wants to dive in?




On Mon, Apr 7, 2014 at 5:09 AM, Mike Rhodes <notifications@github.com>wrote:

> In Classes/common/CDTDatastore+Conflicts.m:
>
> > +                              error:(NSError * __autoreleasing *)error
> > +{
> > +    if (![self.database open]) {
> > +        *error = TDStatusToNSError(kTDStatusException, nil);
> > +        return NO;
> > +    }
> > +
> > +    NSArray *revsArray = [self activeRevisionsForDocumentId:docId];
> > +
> > +    if(revsArray.count <= 1) //no conflicts for this doc
> > +        return YES;
> > +
> > +    CDTDocumentRevision *resolvedRev = [resolver resolve:docId conflicts:revsArray];
> > +
> > +    if(resolvedRev == nil) //do nothing
> > +        return YES;
>
> Have any changes been made for this?
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/cloudant/CDTDatastore/pull/22/files#r11340609>
> .
>