@@ -344,37 +344,25 @@ func (cd *clientDoc) _hasConflict(t testing.TB, incomingHLV *db.HybridLogicalVec
344344 return false
345345}
346346
347- func (btcc * BlipTesterCollectionClient ) _resolveConflict (incomingHLV * db.HybridLogicalVector , incomingBody []byte , incomingIsDelete bool , localDoc * clientDocRev ) (body []byte , hlv db.HybridLogicalVector , isTombstone bool ) {
347+ func (btcc * BlipTesterCollectionClient ) _resolveConflict (incomingHLV * db.HybridLogicalVector , incomingBody []byte , localDoc * clientDocRev ) (body []byte , hlv db.HybridLogicalVector ) {
348348 switch btcc .parent .ConflictResolver {
349349 case ConflictResolverLastWriteWins :
350350 return btcc ._resolveConflictLWW (incomingHLV , incomingBody , localDoc )
351351 }
352352 btcc .TB ().Fatalf ("Unknown conflict resolver %q - cannot resolve detected conflict" , btcc .parent .ConflictResolver )
353- return nil , db.HybridLogicalVector {}, isTombstone
353+ return nil , db.HybridLogicalVector {}
354354}
355355
356- func (btcc * BlipTesterCollectionClient ) _resolveConflictLWW (incomingHLV * db.HybridLogicalVector , incomingBody []byte , latestLocalRev * clientDocRev ) (body []byte , hlv db.HybridLogicalVector , isTombstone bool ) {
356+ func (btcc * BlipTesterCollectionClient ) _resolveConflictLWW (incomingHLV * db.HybridLogicalVector , incomingBody []byte , latestLocalRev * clientDocRev ) (body []byte , hlv db.HybridLogicalVector ) {
357357 latestLocalHLV := latestLocalRev .HLV
358358 updatedHLV := latestLocalRev .HLV .Copy ()
359- localDeleted := latestLocalRev .isDelete
360- incomingIsDelete := incomingBody == nil || bytes .Equal (incomingBody , []byte (`{}` ))
361- if localDeleted && ! incomingIsDelete {
362- // resolve in favour of local document
363- incomingHLV .UpdateWithIncomingHLV (updatedHLV )
364- return latestLocalRev .body , * updatedHLV , true
365- }
366- if incomingIsDelete && ! localDeleted {
367- // resolve in favour of remote document
368- updatedHLV .UpdateWithIncomingHLV (incomingHLV )
369- return incomingBody , * updatedHLV , true
370- }
371359 // resolve conflict in favor of remote document
372360 if incomingHLV .Version > latestLocalHLV .Version {
373361 updatedHLV .UpdateWithIncomingHLV (incomingHLV )
374- return incomingBody , * updatedHLV , incomingIsDelete
362+ return incomingBody , * updatedHLV
375363 }
376364 incomingHLV .UpdateWithIncomingHLV (updatedHLV )
377- return latestLocalRev .body , * updatedHLV , latestLocalRev . isDelete
365+ return latestLocalRev .body , * updatedHLV
378366}
379367
380368type BlipTesterCollectionClient struct {
@@ -2199,15 +2187,14 @@ func (btcc *BlipTesterCollectionClient) addRev(ctx context.Context, docID string
21992187 btcc .seqLock .Lock ()
22002188 defer btcc .seqLock .Unlock ()
22012189 newClientSeq := btcc ._nextSequence ()
2202- isDelete := opts .isDelete
22032190
22042191 newBody := opts .body
22052192 newVersion := opts .incomingVersion
22062193 doc , hasLocalDoc := btcc ._getClientDoc (docID )
22072194 updatedHLV := doc ._getLatestHLVCopy (btcc .TB ())
22082195 require .NotNil (btcc .TB (), updatedHLV , "updatedHLV should not be nil for docID %q" , docID )
22092196 if doc ._hasConflict (btcc .TB (), opts .incomingHLV ) {
2210- newBody , updatedHLV , isDelete = btcc ._resolveConflict (opts .incomingHLV , opts .body , opts . isDelete , doc ._latestRev (btcc .TB ()))
2197+ newBody , updatedHLV = btcc ._resolveConflict (opts .incomingHLV , opts .body , doc ._latestRev (btcc .TB ()))
22112198 base .DebugfCtx (ctx , base .KeySGTest , "Resolved conflict for docID %q, incomingHLV:%#v, existingHLV:%#v, updatedHLV:%#v" , docID , opts .incomingHLV , doc ._latestRev (btcc .TB ()).HLV , updatedHLV )
22122199 } else {
22132200 base .DebugfCtx (ctx , base .KeySGTest , "No conflict" )
@@ -2220,7 +2207,7 @@ func (btcc *BlipTesterCollectionClient) addRev(ctx context.Context, docID string
22202207 // ConflictResolver is currently on BlipTesterClient, but might be per replication in the future.
22212208 docRev := clientDocRev {
22222209 clientSeq : newClientSeq ,
2223- isDelete : isDelete ,
2210+ isDelete : opts . isDelete ,
22242211 pullMessage : opts .msg ,
22252212 body : newBody ,
22262213 HLV : updatedHLV ,
0 commit comments