We are hitting a problem whereby our ActiveSync mail clients makes a Sync request to Exchange, and periodically receives a HTTP 500 response.
I have looked at the server logs and have determined that this is what happens:
1) Client makes Sync request with Folder Sync Key 1
2) Exchange returns data to the front end server with HTTP 200 and valid sync data + Folder Sync Key 2
3) Front end server returns HTTP 500 to the client device Client device makes another Sync request with Sync key 1(Since it has not received valid data to request 1 above)
4) Server responds with HTTP 200 + no data + no new Sync key New mail arrives at the server
5) Client makes sync request with Sync key 1
6) Server returns new mail to the client + sync key 3
I do not understand how to recover the payload of the response that was returned in step (2) above. It is lost forever unless the client resets its sync key for the folder to 0 and resyncs the entire folder. I want to avoid this, since we hit these 500 errors multiple times a day.
Is there any way to recover the lost mail by altering the parameters of subsequent sync requests with the original folder sync key?
Here's what was happening with this for anyone else who hits it.
The Ping / Sync loop works in a way that if you issue a Ping after this HTTP 500 error, the server will assume that you have moved to the next sync key (i.e the sync key that was returned in the missing HTTP 500 response). If, instead of making a new Ping request, a new Sync request is made, then the missing email will be returned, since the server will assume that the client has not yet moved to the new sync key.