locked
SaveChangeContext in the SaveItemChange Method of a Custom Sync Provider RRS feed

  • Question

  • Hello!

     

    I'm putting together a custom sync provider (two, actually) for my current project, but in testing, when SaveItemChange is called, the SaveChangeContext argument is null. What is used to get that value? The provider has been pieced-together over several different time periods over the past few weeks, so something might've been left out/forgotten. I tried looking through the ManagedNTFSProvider sample, but the only times the SaveChangeContext class appeared was in the SaveItemChange declaration, and in its comments. Thanks in advance for the help!

     

    -A. Chapin

    • Moved by Max Wang_1983 Thursday, April 21, 2011 10:17 PM forum consolidation (From:SyncFx - Technical Discussion [ReadOnly])
    Monday, February 4, 2008 9:39 PM

Answers

  • In this case the data didn’t change and the only thing that changed is the version. So, we don’t retrieve the data (the destination already has the latest data). The destination provider just needs to update the version for the item on the destination to the version in the SaveChangeContext.

     

    Hope that helps.

    Liam

    Tuesday, February 5, 2008 9:16 PM

All replies

  • Can you check the arguments to the change applier?  I think you may be passing null to one of them.

    Monday, February 4, 2008 10:54 PM
  • All the arguments passed to the change applier have values. The SaveChangeContext exists, but the ChangeData is null. Then I found that LoadChangeData isn't being called (hence why there's no ChangeData,) when the SaveChangeAction is UpdateVersionOnly. When an item is being added, everything is hunky-dory. I guess the sync just doesn't call that method if the action is UpdateVersionOnly.

    Tuesday, February 5, 2008 4:43 PM
  • In this case the data didn’t change and the only thing that changed is the version. So, we don’t retrieve the data (the destination already has the latest data). The destination provider just needs to update the version for the item on the destination to the version in the SaveChangeContext.

     

    Hope that helps.

    Liam

    Tuesday, February 5, 2008 9:16 PM
  • For some reason, though, when the ItemChange is Update, the SaveChangeAction is always UpdateVersionOnly, even when the metadata/item has definitely changed. It's been able to determine when an item is created, so I know they're not ALL set to UpdateVersionOnly. How/Where does the sync framework decide what type of change the action is? Thanks!

     

    -Aaron

    Wednesday, February 6, 2008 5:46 PM