I have an event in Outlook with an attendee that uses Google calendar. When I change the event recurrence range type using the graph API from "noEnd" to "numbered", the google attendee's event does not get updated.
Here is the code I am using to set the recurrence as "noEnd":
public async System.Threading.Tasks.Task SetDailyRecurrenceForever(string ExternalID, string CalendarRefreshToken)
{
var tmpEvent = new Microsoft.Graph.Event
{
Recurrence = new PatternedRecurrence
{
Pattern = new RecurrencePattern
{
Type = RecurrencePatternType.Daily,
Interval = 1,
FirstDayOfWeek = Microsoft.Graph.DayOfWeek.Sunday,
Index = WeekIndex.First
},
Range = new RecurrenceRange
{
Type = RecurrenceRangeType.NoEnd,
StartDate = new Microsoft.Graph.Date(2020,10,6),
RecurrenceTimeZone = "Central Standard Time",
NumberOfOccurrences = 0
}
}
};
var graphClient = await MicrosoftAuthenticationProvider.GetGraphClient(CALENDAR_CLIENT_ID, CALENDAR_CLIENT_SECRET, CALENDAR_REDIRECT_URI, CALENDAR_ACCESS_SCOPES, CalendarRefreshToken)
.ConfigureAwait(false);
await graphClient.Me.Events[ExternalID]
.Request()
.UpdateAsync(tmpEvent)
.ConfigureAwait(false);
}
Here is the code I am using to set the recurrence as "numbered":
public async System.Threading.Tasks.Task SetDailyRecurrenceForFiveDays(string ExternalID, string CalendarRefreshToken)
{
var tmpEvent = new Microsoft.Graph.Event
{
Recurrence = new PatternedRecurrence
{
Pattern = new RecurrencePattern
{
Type = RecurrencePatternType.Daily,
Interval = 1,
FirstDayOfWeek = Microsoft.Graph.DayOfWeek.Sunday,
Index = WeekIndex.First
},
Range = new RecurrenceRange
{
Type = RecurrenceRangeType.Numbered,
StartDate = new Microsoft.Graph.Date(2020, 10, 6),
RecurrenceTimeZone = "Central Standard Time",
NumberOfOccurrences = 5
}
}
};
var graphClient = await MicrosoftAuthenticationProvider.GetGraphClient(CALENDAR_CLIENT_ID, CALENDAR_CLIENT_SECRET, CALENDAR_REDIRECT_URI, CALENDAR_ACCESS_SCOPES, CalendarRefreshToken)
.ConfigureAwait(false);
await graphClient.Me.Events[ExternalID]
.Request()
.UpdateAsync(tmpEvent)
.ConfigureAwait(false);
}
The bug is also repeatable by sending a PATCH using the graph explorer: https://graph.microsoft.com/v1.0/me/events/{ID}
Update the event as "noEnd":
{"recurrence":{"pattern":{"type":"daily","interval":1,"month":0,"dayOfMonth":0,"firstDayOfWeek":"sunday","index":"first"},"range":{"type":"noEnd","startDate":"2020-10-06","endDate":"0001-01-01","recurrenceTimeZone":"Central Standard Time","numberOfOccurrences":0}}}
Update the event as "numbered":
{"recurrence":{"pattern":{"type":"daily","interval":1,"month":0,"dayOfMonth":0,"firstDayOfWeek":"sunday","index":"first"},"range":{"type":"numbered","startDate":"2020-10-06","endDate":"0001-01-01","recurrenceTimeZone":"Central Standard Time","numberOfOccurrences":5}}}
The following video displays the behavior the google attendee is experiencing: https://www.screencast.com/t/uhwovvZf
Note: At the end of the video I show that switching the interval to 2 will cause the google event to be updated properly, so this is specifically a problem when the interval is 1.
Is this a known bug? Does anyone have a work-around for it?