OfficeDev / ews-managed-api

Other
584 stars 316 forks source link

Missing occurrences of Cancelled Meetings from Deleted Items #247

Open LCvijovic09 opened 4 years ago

LCvijovic09 commented 4 years ago

Hi, I recently started working with EWS Managed API and I am trying to find some cancelled meetings in attendees Deleted Items folder. There is a specific scenario when I can't find every cancelled meeting in Deleted Items. The steps go:

  1. Another person creates a recurring meetings with my mailbox
  2. Another person then cancels 3 random occurrences. (That are not one after another)
  3. In my Deleted Items I can see all three occurrences that have been canceled
  4. Try to list Cancelled Meetings from Deleted Items folder using EWS Managed API and get only first and third Cancelled Meetings. For some reason the second one is not displayed.

As for the code, I am looking like this:

var itemView = new ItemView(250)
{
      PropertySet = new PropertySet(BasePropertySet.FirstClassProperties)
};

var searchAndFilterCancelledMeetingCollection = new List<SearchFilter>
{
      new SearchFilter.IsGreaterThanOrEqualTo(ItemSchema.LastModifiedTime, mailbox.LastCalendarImport.Value.AddDays(-1)),
      new SearchFilter.IsEqualTo(ItemSchema.ItemClass, "IPM.Schedule.Meeting.Canceled")
};

var searchAndFilterCancelledMeeting = new SearchFilter.SearchFilterCollection(LogicalOperator.And, searchAndFilterCancelledMeetingCollection);

var resultsCM = exchangeService.FindItems(WellKnownFolderName.DeletedItems, searchAndFilterCancelledMeeting, itemView).Select(s =>
{
      s.Load();
      return s;
}).ToList();

Things to note:

Did not have much luck google-ing this issue, so I hoped maybe someone here could help. Thanks. Looking forward to any response :)

Regards, Lazar