-
Notifications
You must be signed in to change notification settings - Fork 263
Description
Describe the bug
When creating or patching a change notification subscription using the .NET MS graph SDK, the ExpirationDateTime is not set to the expected value. I am creating a subscription using the code from https://learn.microsoft.com/en-us/graph/change-notifications-delivery-webhooks?tabs=csharp#subscription-request. I set my ExpirationDateTime value as a DateTimeOffset for 10065 minutes from creation (which should be acceptable for messages according to https://learn.microsoft.com/en-us/graph/api/resources/subscription?view=graph-rest-1.0#subscription-lifetime) and pass it into a new Subscription object. When the request is completed and the subscription object is returned, the ExpirationDateTime does not represent the value I'm setting. It's usually only a day in advance when I would expect it to be around 6 days from creation. The same issue occurs when updating subscriptions using the code from https://learn.microsoft.com/en-us/graph/api/subscription-update?view=graph-rest-1.0&tabs=csharp#request. I have also tried to pass in the ExpirationDateTime as an AdditionalData parameter (suggested in #2269) and the issue persists.
Expected behavior
The resulting subscription object has the expirationDateTime value I provided.
How to reproduce
- Create C# project and instantiate new GraphServiceClient
- Create subscription using code at https://learn.microsoft.com/en-us/graph/change-notifications-delivery-webhooks?tabs=csharp#subscription-request and set ExpirationDateTime with something like DateTimeOffset.UtcNow.AddMinutes(10065).
- Inspect the returned Subscription object and see that the ExpirationDateTime is not what was passed in.
SDK Version
No response
Latest version known to work for scenario above?
No response
Known Workarounds
No response
Debug output
Click to expand log
```</details>
### Configuration
_No response_
### Other information
_No response_