OfficeDev / ews-managed-api

Other
584 stars 316 forks source link

SyncFolderItems Sync State Max Size - EWS Managed API #220

Open anilreddyr7 opened 5 years ago

anilreddyr7 commented 5 years ago

We are trying to use SyncFolderItems EWS operation. The request is below.

<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

IdOnly 10 NormalItems **Response:** NoError H4sIAAA== true ------------it has more The sync state value is growing bigger after each sync folder items request. We have observed it occupies 10 pages. It is not finite in length. What is the maximum size of the sync state and how you are handling sync state field on your side?
pkropachev commented 5 years ago

I didn't find any information about size of SyncState field when I was interested in this question. The one of drawback with SyncFolderItems method is the fact that the synchronization state can become quite big. In my case:

Number of items SyncState (in bytes)
512 1804
1024 2464
1536 3040
2048 3504
davster commented 5 years ago

The size can grow, but when you get to the end of the current set of changes the size should collapse. There are pathological cases which can cause the sync state to become very large, but typically it's not too bad. Outlook Desktop has to upload the entire sync state every time you receive a new mail. So it won't grow forever.

there is no concept of resetting the sync state. You can start over, but after you sync the state should be the same. It's a reflection of the items in the folder. The more items in the folder the larger the state "can" get. Since the state stores sets of ID or CN values in a perfect world the sync state should be small if all IDs or CNs are contiguous. It can get large if there are lots of holes in the sets.