0
votes

The subscription created for listening event updates in calendar is getting triggered multiple times. even though there is only one subscription registered for url.

The api used for subscription is POST https://graph.microsoft.com/v1.0/subscriptions

with body payload as below :-

{
   "changeType": "updated",
   "notificationUrl": "https://*******.ngrok.io/v1/microsoft/notify_me",
   "resource": "me/events",
   "expirationDateTime":"2020-05-30T22:23:45.9356913Z",
   "clientState": "secretClientValue",
   "latestSupportedTlsVersion": "v1_2"
}

After successful registration the hooks are getting called insanely multiple times, I must make sure it gets called once as i've to perform critical db operations.

What am i doing wrong? why the hook is getting called multiple times ?

I also tried the delta function but it didn't worked and throws following error.

{
    "error": {
        "code": "BadRequest",
        "message": "Unsupported request: Change tracking is not supported against 'microsoft.graph.event'.",
        "innerError": {
            "request-id": "bb74dcd2-2890-41f6-a88c-2cc4b2e06078",
            "date": "2020-06-01T06:36:14"
        }
    }
}
1

1 Answers

0
votes

Is it possible that during your development flow you created multiple subscriptions to the same resource? (starting and stopping debug for example).

Regardless, there's no guarantee that change notifications will be delivered only once for a specific change, the subscriber should always deduplicate received notifications using the notification id, the resource id or a combination both.

Lastly, delta is supported for events but it requires providing a start and end date.