Skip to content

(#358) Default Offline conflict resolver. #382

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 23, 2025

Conversation

adrianhall
Copy link
Collaborator

Within the code, you can use

builder.UseDefaultConflictResolver(resolver);

to set a new conflict resolver.

@adrianhall adrianhall requested a review from Copilot June 23, 2025 19:17
@adrianhall adrianhall self-assigned this Jun 23, 2025
@adrianhall adrianhall linked an issue Jun 23, 2025 that may be closed by this pull request
@adrianhall adrianhall added this to the 9.0.4 milestone Jun 23, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a configurable default conflict resolver for offline operations, allowing users to set a fallback resolver when no entity-specific resolver is provided. Key changes include:

  • Exposing UseDefaultConflictResolver on DatasyncOfflineOptionsBuilder
  • Adding DefaultConflictResolver to OfflineOptions and using it in option lookups
  • Covering the default conflict resolver path with a new integration test

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tests/CommunityToolkit.Datasync.Client.Test/Offline/ConflictResolver_Tests.cs Added PushAsync_WithDefaultClientWinsResolver_ShouldResolveConflictAndRetry test
src/CommunityToolkit.Datasync.Client/Offline/Models/OfflineOptions.cs Introduced DefaultConflictResolver property and applied it in GetOptions methods
src/CommunityToolkit.Datasync.Client/Offline/DatasyncOfflineOptionsBuilder.cs Added _defaultConflictResolver field, UseDefaultConflictResolver method, and set builder output

@adrianhall adrianhall merged commit ec58dcb into CommunityToolkit:main Jun 23, 2025
5 checks passed
@adrianhall adrianhall deleted the issues/358 branch June 23, 2025 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DatasyncOfflineOptionsBuilder, default conflict resolver
1 participant