OfficeDev / ews-managed-api

Other
584 stars 319 forks source link

ErrorCalendarEndDateIsEarlierThanStartDate error on modifying EndDate of meeting on DST boundary #158

Open tjmoore opened 6 years ago

tjmoore commented 6 years ago

(also posted in dev forums, but haven't got anywhere. This looks like a bug to me, although not sure if EWS client is not creating the SOAP requests quite right, or an issue with the back end of EWS. https://social.msdn.microsoft.com/Forums/sqlserver/en-US/162bf73d-6875-4d59-94de-07075892fd2f/e2013exchangeonlineewsewsmacwindows-errorcalendarenddateisearlierthanstartdate-error?forum=exchangesvrdevelopment)

I have an issue with EWS when updating an existing calendar meeting on a room resource that has been booked across a DST boundary.

For example, I have a meeting booked for 2018-10-28T00:55:00Z to 2018-10-28T02:30:00Z with the start and end time zones set to GMT Standard Time. This crosses the BST to GMT daylight savings boundary which occurs at 02:00 where it will roll back an hour to 01:00. When booked in Outlook from a UK based client, the meeting is booked in the UI for 2018-10-28 at 01:55 (BST) to 02:30 (GMT).

The client application has the need to truncate meetings, and on setting the End field to an earlier time (e.g. 2018-10-28T01:06:00.000Z), the response through EWS is ErrorCalendarEndDateIsEarlierThanStartDate.

The code is using EWS Managed API 2.2, but I have enabled tracing and got the request and responses. I can then send these via EWSEditor using EWS POST, and I get the same result.

I feel this is an issue with EWS itself not handling updates to meetings across DST boundaries.

As an example I have attached the SOAP requests and responses below.

Note the Start and End in the response on binding the appointment...

**2018-10-28T00:55:00Z</t:Start>

2018-10-28T02:30:00Z** and I'm requesting End to be changed as follows... **2018-10-28T01:06:00.000Z** All UTC times and End is definitely not before Start. I have tried specifically setting StartTimeZone and EndTimeZone to TimeZoneInfo.Utc with no affect. The ExchangeService has time zone context set to UTC also. As can be seen from the SOAP XML, the times are all UTC as expected. Request generated on **Appointment.Bind**: ```xml ?xml version="1.0" encoding="utf-8"?> TestRoom1@XXXXXXX IdOnly Text ``` Response: ```xml NoError test 040000008200E00074C5B7101A82E00800000000187AF5E888A5D301000000000000000010000000A9ECEFD633F7C14AB8B027D04022B359 2018-10-28T00:55:00Z 2018-10-28T02:30:00Z trule:Microsoft/Registry/GMT Standard Time/1-Daylight PT1H 3 Sunday -1 trule:Microsoft/Registry/GMT Standard Time/1-Standard PT2H 10 Sunday -1 0 trule:Microsoft/Registry/GMT Standard Time/1-Daylight PT1H 3 Sunday -1 trule:Microsoft/Registry/GMT Standard Time/1-Standard PT2H 10 Sunday -1 0 ``` Then on updating by setting **appointment.End** to 2018-10-28T01:06:00.000Z and calling **appointment.Update(ConflictResolutionMode.AutoResolve, SendInvitationsOrCancellationsMode.SendToNone)**: ```xml TestRoom1@XXXXXX 2018-10-28T01:06:00.000Z ``` Response: ```xml EndDate is earlier than StartDate ErrorCalendarEndDateIsEarlierThanStartDate 0 ```
davster commented 6 years ago

Thanks for reporting this. I have opened a bug on our side for the calendaring team to dig into the issue.

oranasraf commented 6 years ago

I'm having this issue also. Thanks for sharing, will keep an eye for this issue.

tjmoore commented 6 years ago

Just checking if there's any update or can we track the bug raised on your side?

Also, are there going to be any future EWS releases (via nuget etc) as there have been fixes over time since 2.2 back in 2014 but no releases it seems? Or do we have to just build from source if we want latest?