microsoftgraph / microsoftgraph/msgraph-sdk-dotnet

Patching a TodoTask which has a Recurrence value fails

Open
#2,677 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Needs: Attention :wave: Service issue type:bug
Dominant language
C#
Stars
789
Forks
264
Avg merge
15h 17m
Merged PRs (30d)
3

Description

Describe the bug

I am trying to patch an existing TodoTask that has a recurrence value. It loads fine, but when I go to patch it (even with no changes), it results in:
Invalid JSON, Error converting value "2025-09-23" to type 'Microsoft.OData.Edm.Date'. Path 'recurrence.range.endDate', line 1, position 46.

Expected behavior

It should patch the TodoTask without error and set the Recurrence changes.

How to reproduce
TodoTask tdTemp = new();
tdTemp.Recurrence = new()
    {
        Range = new()
        {
            Type = RecurrenceRangeType.EndDate,
            StartDate = new(DateTime.Now),
            EndDate = new(DateTime.Now.AddYears(1))
        }
    };
var result = await GraphClient.Users[MSGraphId.ToString()].Todo.Lists[list.Id].Tasks[task.Id].PatchAsync(tdTemp);
SDK Version

5.58.0

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output
Click to expand log ```
</details>


### Configuration

Windows 11, x64.

### Other information

Someone else reported it here:
https://learn.microsoft.com/en-gb/answers/questions/806339/unable-to-patch-a-todo-task-with-a-recurrence-patt

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the C# GraphClient.Users[].Todo.Lists[].Tasks[].PatchAsync call shown in the reproduction and reproduce it using SDK version 5.58.0. Trace how the recurrence range dates are serialized for the patch request; done means an existing TodoTask with an EndDate recurrence patches successfully without the Microsoft.OData.Edm.Date conversion error.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.