resolveDocRemoteWins makes the following changes to the document: - Tombstones the local revision The remote revision is added to the revision tree by the standard update processing.
(ctx context.Context, localDoc *Document, conflict Conflict)
| 1920 | // |
| 1921 | // The remote revision is added to the revision tree by the standard update processing. |
| 1922 | func (db *DatabaseCollectionWithUser) resolveDocRemoteWins(ctx context.Context, localDoc *Document, conflict Conflict) (resolvedRevID string, err error) { |
| 1923 | |
| 1924 | // Tombstone the local revision |
| 1925 | localRevID := localDoc.GetRevTreeID() |
| 1926 | tombstoneRevID, tombstoneErr := db.tombstoneActiveRevision(ctx, localDoc, localRevID) |
| 1927 | if tombstoneErr != nil { |
| 1928 | return "", tombstoneErr |
| 1929 | } |
| 1930 | remoteRevID := conflict.RemoteDocument.ExtractRev() |
| 1931 | base.DebugfCtx(ctx, base.KeyReplicate, "Resolved conflict for doc %s as remote wins - remote rev is %s, previous local rev %s tombstoned by %s, ", base.UD(localDoc.ID), remoteRevID, localRevID, tombstoneRevID) |
| 1932 | return remoteRevID, nil |
| 1933 | } |
| 1934 | |
| 1935 | // localWinsConflictResolutionRevTreeHandling handles the revision tree updates required for local wins conflict |
| 1936 | // resolution. This is used for both legacy conflict resolution and HLV conflict resolution |
no test coverage detected