Skip to content

Creating/updating change notification subscriptions does not return the expected ExpirationDateTime value #2930

@jnemeth1

Description

@jnemeth1

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

  1. Create C# project and instantiate new GraphServiceClient
  2. 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).
  3. 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_

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions