Два раза в год события, созданные с использованием Graph API / SDK, отсутствуют в первом экземпляре - PullRequest
1 голос
/ 30 апреля 2020

Когда я создаю следующее событие с помощью графического SDK, первый экземпляр повторяющегося события не создается до 4 мая 2021 года:

var tmpEvent = new Microsoft.Graph.Event
        {
            Start = new Microsoft.Graph.DateTimeTimeZone
            {
                DateTime = "2020-05-04T16:00:00",
                TimeZone = "Central Standard Time"
            },
            End = new Microsoft.Graph.DateTimeTimeZone
            {
                DateTime = "2020-05-04T17:00:00",
                TimeZone = "Central Standard Time"
            },
            Subject = "Bi-Annual Event",
            Body = new Microsoft.Graph.ItemBody
            {
                Content = "Trying to make a bi-annual event",
                ContentType = Microsoft.Graph.BodyType.Text
            },
            Attendees = new List<Microsoft.Graph.Attendee>{
                new Microsoft.Graph.Attendee
                    {
                        EmailAddress = new Microsoft.Graph.EmailAddress
                        {
                            Address = "test.email.123@someTestDomain.org"
                        },
                        Type = Microsoft.Graph.AttendeeType.Required
                    }
                },
            Location = new Microsoft.Graph.Location
            {
                DisplayName = "the office"
            },
            Recurrence = new PatternedRecurrence
            {
                Pattern = new RecurrencePattern
                {
                    DayOfMonth = 4,
                    Interval = 2,
                    Month = 5,
                    Type = RecurrencePatternType.AbsoluteYearly
                },
                Range = new RecurrenceRange
                {
                    StartDate = new Date(2020, 5, 4),
                    Type = RecurrenceRangeType.NoEnd
                }
            }
        };

        var graphClient = await MicrosoftAuthenticationProvider.GetGraphClient(CALENDAR_CLIENT_ID, CALENDAR_CLIENT_SECRET, CALENDAR_REDIRECT_URI, CALENDAR_ACCESS_SCOPES, RefreshToken);


        var savedEvent = await graphClient.Me.Events
                            .Request()
                            .AddAsync(tmpEvent);

Вот как выглядит повторение в Outlook: введите описание изображения здесь

Когда я сохраняю повторение / серию в Outlook, событие появляется (правильно) 4 мая 2020 года.

Это ошибка с graph SDK?

ОБНОВЛЕНИЕ: Здесь я отправляю запрос тела:

{
  "OriginalStartTimeZone": null,
  "OriginalEndTimeZone": null,
  "ResponseStatus": null,
  "ICalUId": null,
  "ReminderMinutesBeforeStart": null,
  "IsReminderOn": null,
  "HasAttachments": null,
  "Subject": "Bi-Annual Event",
  "Body": {
    "ContentType": 0,
    "Content": "Trying to make a bi-annual event",
    "AdditionalData": null,
    "ODataType": "microsoft.graph.itemBody"
  },
  "BodyPreview": null,
  "Importance": null,
  "Sensitivity": null,
  "Start": {
    "DateTime": "2020-05-04T16:00:00",
    "TimeZone": "Central Standard Time",
    "AdditionalData": null,
    "ODataType": "microsoft.graph.dateTimeTimeZone"
  },
  "OriginalStart": null,
  "End": {
    "DateTime": "2020-05-04T17:00:00",
    "TimeZone": "Central Standard Time",
    "AdditionalData": null,
    "ODataType": "microsoft.graph.dateTimeTimeZone"
  },
  "Location": {
    "DisplayName": "the office",
    "LocationEmailAddress": null,
    "Address": null,
    "LocationUri": null,
    "Coordinates": null,
    "LocationType": null,
    "UniqueId": null,
    "UniqueIdType": null,
    "AdditionalData": null,
    "ODataType": "microsoft.graph.location"
  },
  "Locations": null,
  "IsAllDay": null,
  "IsCancelled": null,
  "IsOrganizer": null,
  "Recurrence": {
    "Pattern": {
      "Type": 4,
      "Interval": 2,
      "Month": 5,
      "DayOfMonth": 4,
      "DaysOfWeek": null,
      "FirstDayOfWeek": null,
      "Index": null,
      "AdditionalData": null,
      "ODataType": "microsoft.graph.recurrencePattern"
    },
    "Range": {
      "Type": 1,
      "StartDate": {
        "Year": 2020,
        "Month": 5,
        "Day": 4
      },
      "EndDate": null,
      "RecurrenceTimeZone": null,
      "NumberOfOccurrences": null,
      "AdditionalData": null,
      "ODataType": "microsoft.graph.recurrenceRange"
    },
    "AdditionalData": null,
    "ODataType": "microsoft.graph.patternedRecurrence"
  },
  "ResponseRequested": null,
  "SeriesMasterId": null,
  "ShowAs": null,
  "Type": null,
  "Attendees": [
    {
      "Status": null,
      "Type": 0,
      "EmailAddress": {
        "Name": null,
        "Address": "test.email.123@someTestDomain.org",
        "AdditionalData": null,
        "ODataType": "microsoft.graph.emailAddress"
      },
      "AdditionalData": null,
      "ODataType": "microsoft.graph.attendee"
    }
  ],
  "Organizer": null,
  "WebLink": null,
  "OnlineMeetingUrl": null,
  "IsOnlineMeeting": null,
  "OnlineMeetingProvider": null,
  "OnlineMeeting": null,
  "Attachments": null,
  "SingleValueExtendedProperties": null,
  "MultiValueExtendedProperties": null,
  "Calendar": null,
  "Instances": null,
  "Extensions": null,
  "CreatedDateTime": null,
  "LastModifiedDateTime": null,
  "ChangeKey": null,
  "Categories": null,
  "Id": null,
  "ODataType": "microsoft.graph.event",
  "AdditionalData": null
}

Ваш запрос выглядит иначе?

Кроме того, я заметил, что это только проблема в настольном клиенте события обычно отображаются в веб-клиенте

...