ConflictResolver

Classes > Sync > ConflictResolver

Resolves conflicts between local and remote changes. Implements spec Section 14 (Conflict Resolution).

public static class ConflictResolver

Methods

IsConflict(SyncLogEntry, SyncLogEntry)

public static bool IsConflict(SyncLogEntry local, SyncLogEntry remote)

Detects if two changes conflict. Conflicts occur when same table+PK changed by different origins.

Parameters:

Name Type Description
local SyncLogEntry
remote SyncLogEntry

Returns: Boolean

Resolve(SyncLogEntry, SyncLogEntry, ConflictStrategy)

public static ConflictResolution Resolve(SyncLogEntry local, SyncLogEntry remote, ConflictStrategy strategy)

Resolves a conflict using the specified strategy.

Parameters:

Name Type Description
local SyncLogEntry
remote SyncLogEntry
strategy ConflictStrategy

Returns: ConflictResolution

ResolveLastWriteWins(SyncLogEntry, SyncLogEntry)

public static ConflictResolution ResolveLastWriteWins(SyncLogEntry local, SyncLogEntry remote)

Resolves conflict using Last-Write-Wins (timestamp comparison). On tie, higher version wins for determinism.

Parameters:

Name Type Description
local SyncLogEntry
remote SyncLogEntry

Returns: ConflictResolution

ResolveCustom(SyncLogEntry, SyncLogEntry, Func<SyncLogEntry, SyncLogEntry, Result<SyncLogEntry, SyncError>>)

public static Result<ConflictResolution, SyncError> ResolveCustom(SyncLogEntry local, SyncLogEntry remote, Func<SyncLogEntry, SyncLogEntry, Result<SyncLogEntry, SyncError>> resolver)

Resolves a conflict using a custom resolution function.

Parameters:

Name Type Description
local SyncLogEntry
remote SyncLogEntry
resolver SyncError>>

Returns: SyncError>