0
votes

I am implementing a sync between our own calendar program and Exchange calendars using EWS managed API. Everything seemed to go well, but when I made a small program to regularly update appointments in our system and in Exchange, to test the sync service, I noticed that the number of appointments in our database was steadily decreasing. It turns out that when I use SyncFolderItems to get updates, Exchange some times says that an appointment is deleted when it's not. So I end up deleting it in our system, but it's still there in the user's exchange calendar. My first thought was that some logic in Exchange caused the appointment to be deleted and remade, but if that was the case I should have been notified that an appointment was created as well. I am not (unless I create one myself).

I tried googling, but I am unable to find anything relevant. 90% of the results are questions about how one would find deleted items.

This is how I get the changes from Exchange:

                do
                {
                    ChangeCollection<ItemChange> icc = m_ECService.SyncFolderItems(
                        new FolderId(WellKnownFolderName.Calendar),
                        PropertySet.IdOnly,
                        m_IgnoredExchangeIDs,
                        512,
                        SyncFolderItemsScope.NormalItems,
                        m_syncStates[m_Employee.EmployeeID]);

                    m_syncStates[m_Employee.EmployeeID] = icc.SyncState;

                    foreach (ItemChange change in icc)
                    {                            
                        switch (change.ChangeType)
                        {
                            case ChangeType.Create:
                                AppointmentCreatedInExchange(change.ItemId.UniqueId);
                                break;
                            case ChangeType.Delete:
                                AppointmentDeletedInExchange(change.ItemId.UniqueId);
                                break;
                            case ChangeType.Update:
                                AppointmentUpdatedInExchange(change.ItemId.UniqueId);
                                break;
                            default:
                                break;
                        }
                    }

                    MoreChangesAvailable = icc.MoreChangesAvailable;

                } while (MoreChangesAvailable);

m_IgnoredExchangeIDs is a list of IDs for the items that I sent to exchange from our database right before asking for updates from exchange. The AppointmentCreated/Deleted/Updated functions updates our database to match the info from exchange.

What is going on here? Why does Exchange say that an appointment is deleted when it is not?

1
Have a look at calendar version logging blogs.technet.microsoft.com/exchange/2012/06/01/… that should tell you want is happening at the store levelGlen Scales

1 Answers

0
votes

If anyone finds this some time in the future, I can say that my problem was that the uniqueID provided by exchange is case sensitive. I stored those IDs in a database and did a case insensitive query. I found that I often had two uniqueIDs that were different only by one letter's case.