locked
ConflictResolutionAction.SkipChange gives me exception error RRS feed

  • Question

  • private static void OnItemConflicting(object sender, ItemConflictingEventArgs args)
    {
        IFileDataRetriever local = (IFileDataRetriever)args.SourceChangeData;
        IFileDataRetriever remote = (IFileDataRetriever)args.DestinationChangeData;
    
        if (local.FileData.Name != remote.FileData.Name)
        {
                args.SetResolutionAction(ConflictResolutionAction.SkipChange);
        }
    }
    

     

    Hi there.


    I'm using FileSyncProvider to do my synchronization jobs.

    Here's my situation that I want/expect:
    - If the same file on both replicas are modified (i.e. its content are changed), I want the conflict resolution policy to be latest writer wins.
    - If the same file on both replicas are renamed to different names, I want to ignore these files and not do anything to them (i.e. skip any change)

    I tried to do this using the code above. However, I get an exception error with this message: "An incorrect conflict resolution action was set on the OnConflict callback."

    Can anyone offer a solution such that I can fulfill my situation successfully? Thank you!
    Thursday, April 1, 2010 4:58 AM

Answers

  • Under the scenairo as you have described, conflict can not be resolved as SkipChange.  What you observed is a behavior by-design. 

    To resolve conflicts as "the last Writer Win", please do e.SetResolutionAction(ConflictResolutionAction.Merge).

    Thanks.


    Leo Zhou ------ This posting is provided "AS IS" with no warranties, and confers no rights.
    Saturday, April 3, 2010 12:52 AM
    Answerer

All replies

  • Under the scenairo as you have described, conflict can not be resolved as SkipChange.  What you observed is a behavior by-design. 

    To resolve conflicts as "the last Writer Win", please do e.SetResolutionAction(ConflictResolutionAction.Merge).

    Thanks.


    Leo Zhou ------ This posting is provided "AS IS" with no warranties, and confers no rights.
    Saturday, April 3, 2010 12:51 AM
    Answerer
  • Under the scenairo as you have described, conflict can not be resolved as SkipChange.  What you observed is a behavior by-design. 

    To resolve conflicts as "the last Writer Win", please do e.SetResolutionAction(ConflictResolutionAction.Merge).

    Thanks.


    Leo Zhou ------ This posting is provided "AS IS" with no warranties, and confers no rights.
    Saturday, April 3, 2010 12:52 AM
    Answerer