-
Notifications
You must be signed in to change notification settings - Fork 29
Description
When the service responds with a conflict during offline operations, that operation is permanently failed, leaving the developer with a problem on how to deal with it.
Suggested API involves the entity setup. Inside the offline client builder, allow developers to add a conflict resolver. Suggested interface:
Public interface IConflictResolver<T>
{
Task<ConflictResult<T>> ResolveConflictAsync(DatasyncContext context, T clientEntity, T serverEntity, CancellationToken ct = default);
}
The response is a conflict result, which has values that can be used to determine the result of the conflict resolution - either Succeeded, UserInputRequired, etc.
Then provide a “DefaultConflictResolver” (which would be userinputrequired) “ClientSideWinsConflictResolver” and “ServerSideWinsConflictResolver” (probably need better names) that provide unattended conflict resolution.
The conflictresult (instead of the normal serviceresponse) would be added to the failed requests result if the conflict cannot be handled.