Skip to content

[Client bug]: batch request vs non-batch request - inconsistent DateTime results #587

@arnederuwe

Description

@arnederuwe

Describe the bug
When querying the graph API, there is a difference in how DateTimes are serialized when querying with or without batching.
With batching, the serialized DateTime isn't ISO 8601 compliant, therefore the ToDateTime() extension method inside this repository is throwing a FormatException.

When inspecting the graph response JSON, the date format is the same in both the batched and not-batched request, so this is most likely a client bug.

To Reproduce
Steps to reproduce the behavior:
Run the attached project, after filling in tenant/clientid/secret...
The console will first log the startdates of events queried without batching and then the same startdates queried with batching.

Expected behavior
Executing a query against graph with batching should yield exactly the same DTO response as without batching

Screenshots
image

Client version
Packages used:

<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.2.0" />
<PackageReference Include="Microsoft.Graph" Version="1.20.0" />
<PackageReference Include="Microsoft.Graph.Auth" Version="1.0.0-preview.0" />
<PackageReference Include="Microsoft.Graph.Core" Version="1.19.0-preview.3" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.3.0" />

Desktop (please complete the following information):

  • OS: Win10
  • Net Core 3 console app, the same behavior in a .NET Standard class lib

Additional context
msgraph-batch-issue.zip

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions