Skip to main content
For applications with specific requirements, PocketSync allows implementing custom conflict resolution logic:
  • Set the conflict strategy to ConflictResolutionStrategy.custom
  • Provide a custom resolver function that implements the ConflictResolver type
  • The resolver receives both conflicting changes and must return the winning change
To use a custom conflict resolver, you must:
  • Set the conflictResolutionStrategy to ConflictResolutionStrategy.custom in PocketSyncOptions
  • Provide your custom resolver function in the customResolver parameter
Example configuration:

Custom Conflict Resolver

The custom conflict resolver function receives two parameters: The resolver must return the winning change.

Example

The change object has the following properties:
Import note: The data property should always contain a “old” and “new” key. This is needed to maintain consistency with the default conflict resolution strategy.

Conflict Resolution Process