locked
How to mark the file as not in sync using Cloud Files API and dehydrate it? RRS feed

  • Question

  • I have implemented CF_CALLBACK_TYPE_FETCH_PLACEHOLDERS callback and CF_CALLBACK_TYPE_FETCH_DATA callback using Cloud Files Windows API and it is working well. Files sync from server to client properly.

    Now at some point a file is modified on the server. How do I properly mark it as not in sync on the client?

    • Should I directly call the CfSetInSyncState() function? 
    • Do I dehydrate the placeholder manually on the client using CfUpdatePlaceholder() or is it automatic?
    • What is the role of StorageProviderSyncRootInfo.InSyncPolicy in this process?
    Sunday, July 12, 2020 5:31 AM

All replies

  • Hi WebDAV,

    If the sync root file is a full file and the contents of the file in the cloud service change, the service is responsible of notifying the local sync client of the change and the local sync client must handle merges according to their own specifications.

    Would you mind sharing the detailed OS? And if you still want to know the details, please also share the details how you implement on the server side and client side. 

    Regards & Fei


    "Win32 API" forum will be migrating to a new home on Microsoft Q&A !
    We invite you to post new questions in the "Win32 API" forum’s new home on Microsoft Q&A !
    For more information, please refer to the sticky post.

    Wednesday, July 15, 2020 1:26 AM
  • Fei Xue, this question is not about merging, there is no any merging required. This is a one-way server to client synchronization. The question is what Cloud Files API to use to mark file as not in sync and start dehydration.

    You are welcome to browse the code here: https://github.com/microsoft/Windows-classic-samples/tree/master/Samples/CloudMirror

     
    Wednesday, July 15, 2020 5:36 AM
  • Hi WebDAV,

    Thanks for sharing the code sample.

    Did you mean that you after that the files sync to the client, you modify the file on the cloud and you expected the files should be also synced to the client? If not, would you mind sharing the exact steps you were trying? Below is document for the CloudMirror sample. Did you want to implement the function which not implemented with bold text?

    When it comes to syncing, these are the things that a fully-developed cloud files sync provider must implement:

    When the sync root file is just a placeholder, the service is responsible for copying down the contents of the file for hydration. This is implemented in the sample.
    When the sync root file is a full file and the contents of the file in the cloud service change, the service is responsible of notifying the local sync client of the change and the local sync client must handle merges according to their own specifications. This is not implemented in the sample.
    When the sync root file is a full file and the contents of the file in the sync root path (the local client) change, the local sync client must notify the cloud service and handle merges according to their own specifications. The local file change notification is implemented in the sample, but it does not do anything.

    Regards & Fei


    "Win32 API" forum will be migrating to a new home on Microsoft Q&A !
    We invite you to post new questions in the "Win32 API" forum’s new home on Microsoft Q&A !
    For more information, please refer to the sticky post.

    Friday, July 17, 2020 2:10 AM
  • Hi Fei Xue,

    Here is the scenario:

    1. Files are synchronized from server to client.
    2. One file is changed on the server.
    3. The server notifies the client that the file is modified. 

    Now how do I mark the file as not in sync using Cloud Files API on the client machine? So it dehydrates if necessary? What do I do if the file is pinned (my understanding that it is prohibited do dehydrate such files)?


    Saturday, July 18, 2020 4:41 AM
  • Hi WebDav,

    >Now how do I mark the file as not in sync using Cloud Files API on the client machine? So it dehydrates if necessary? What do I do if the file is pinned (my understanding that it is prohibited do dehydrate such files)?

    If the server notifies the client that the file is modified then why do we need to modify the file as not in sync using cloud files API on the client machine and dehydrate it? what does dehydrate do  and purpose ? 

    And the offical code sample you mentioned above is developing the client on server on the same machine. Are you developing with this code sample or develop for a product usage? Is client and server running on the same machine or different machines ? 

    Regards & Fei


    "Win32 API" forum will be migrating to a new home on Microsoft Q&A !
    We invite you to post new questions in the "Win32 API" forum’s new home on Microsoft Q&A !
    For more information, please refer to the sticky post.

    Friday, August 7, 2020 1:06 AM