none
Sync Command Not Just giving me what I am requesting RRS feed

  • Question

  • I am trying to Sync email with Activesync protocol. Based on the protocol documents I should only receive changes that where made to the email folder. Instead of receiving just the change, I receive the whole inbox instead.

     

     

    I first sent this request

    <?xml version="1.0" encoding="utf-8"?> 

    <Sync xmlns="AirSync:"> 

    <Collections> 

    <Collection> 

    <Class>Email</Class> 

    <SyncKey>0</SyncKey> 

    <CollectionId>1</CollectionId> 

    </Collection> 

    </Collections> 

    </Sync> 

     

    After I get a response I get the synckey and place it into this next request

     

     

    <?xml version="1.0" encoding="utf-8"?> 

    <Sync xmlns="AirSync:"> 

    <Collections> 

    <Collection> 

    <Class>Email</Class> 

    <SyncKey>(synckeyfromserver)</SyncKey> 

    <CollectionId>1</CollectionId> 

    <DeletesAsMoves/> 

    <GetChanges/> 

    </Collection> 

    </Collections> 

    </Sync> 

     

     

     

    The server responds with all my inbox email rather than just the change that was made such as just a single email that was receive.  What am I doing wrong here?

    Tuesday, November 15, 2011 10:19 AM

Answers

  • I actually think your response is OK.

    There are basically three possible sync scenarios you need to separate out:

    1. Client sends a sync key that matches last stored key with the server. This is standard sync and server returns a new key and status=1 (ok)
    2. Client sends a sync key of value 0. This is called the initial sync and server returns and new key and status=1 (ok).
    3. Client sends a sync key that does not match last stored key with the servcer. Server then returns status=3 (client must return to SyncKey 0)

    In your example you are doing 2) then 3) which is OK. But in this case the server SHOULD return ALL its stored items to the client. First after a subsequent standard sync according to 1), the server will send ONLY its LATEST changes back to the client.

    Wednesday, November 30, 2011 4:49 PM

All replies

  • Hi DeanSync,

     

    Thanks for your question.

     

    Someone from our team will get in touch with you shortly to follow up.

     

    Thanks and regards,


    SEBASTIAN CANEVARI - MSFT Escalation Engineer Protocol Documentation Team
    Tuesday, November 15, 2011 9:25 PM
  • Hi DeanSync,

    I'm looking into this and will get back to you shortly.

    Best regards,
    Tom Jebo
    Escalation Engineer
    Microsoft Open Specifications

    Wednesday, November 16, 2011 1:56 PM
    Moderator
  • DeanSync,

    did you obtain the CollectionId from the ServerId from your FolderSync command response?

    Tom

    Wednesday, November 16, 2011 2:49 PM
    Moderator
  • I actually think your response is OK.

    There are basically three possible sync scenarios you need to separate out:

    1. Client sends a sync key that matches last stored key with the server. This is standard sync and server returns a new key and status=1 (ok)
    2. Client sends a sync key of value 0. This is called the initial sync and server returns and new key and status=1 (ok).
    3. Client sends a sync key that does not match last stored key with the servcer. Server then returns status=3 (client must return to SyncKey 0)

    In your example you are doing 2) then 3) which is OK. But in this case the server SHOULD return ALL its stored items to the client. First after a subsequent standard sync according to 1), the server will send ONLY its LATEST changes back to the client.

    Wednesday, November 30, 2011 4:49 PM