none
Question about the FileSyncProvider, timestamps and UTC RRS feed

  • Question

  • On the local client we are using a FileSyncProvider and on the remote server we are using an implementation of the FullEnumerationSyncProvider which stores files on Azure.

    We're coming across a problem where the Sync Framework is trying to apply an update to a file because it thinks it's changed, but hasn't. I think the problem may be because of a mismatch between the timestamps on the local files and the timestamps that the server is returning.

    The ApplyingChangeEventArgs for the update that is being applied from the server to the client are:

    CurrentFileData.CreationTime: 08/10/2010 15:47
    CurrentFileData.LastAccessTime: 01/01/1601 00:00
    CurrentFileData.LastWriteTime: 08/10/2010 15:47
    CurrentFileData.Size: 169653

    NewFileData.CreationTime: 08/10/2010 14:47
    NewFileData.LastAccessTime: 01/01/1601 00:00
    NewFileData.LastWriteTime: 08/10/2010 14:47
    NewFileData.Size: 169653

    So I'm assuming that the Sync Framework wants to update the file because the timestamps differ. NewFileData is coming from the server, which always stores and returns times in UTC. The client is installed with UK time, currently UTC+1.

    Can anyone offer any suggestions?


    Friday, October 8, 2010 4:29 PM

Answers

  • Hello tjrobinson,

     

    I apologize for the late reply. Here is what I suspect is happening.

    The cause of unnecessary flow back of unchanged file is that, 

    the time stamp recorded onto metadata store (i.e. the UTC + 1 version) is different from

    the time stamp retrieved from Azure file (UTC version).

     

    Here is what I would suggest. When you record the file, you need to either

    1) fix the timestamps on these files to match the client's time zone by using Azure API as you write the files, or

    2) store these time stamps from local onto azure storage along with the files. Then, manage the time stamps such that if update happens you will update these side data (i.e. time stamps) as well.

    Then, when you enumerate items you will report the timestamp in client time zone.

     

    Hope this helps,

    Patrick

     

     

    Wednesday, October 13, 2010 6:21 PM