Skip to content

[ENG-3815] feat(microsoft): Impl Delete Subscription#2880

Open
Cobalt0s wants to merge 1 commit into
cobalt0s/microsoft-subscribe-createfrom
cobalt0s/microsoft-subscribe-delete
Open

[ENG-3815] feat(microsoft): Impl Delete Subscription#2880
Cobalt0s wants to merge 1 commit into
cobalt0s/microsoft-subscribe-createfrom
cobalt0s/microsoft-subscribe-delete

Conversation

@Cobalt0s
Copy link
Copy Markdown
Contributor

@Cobalt0s Cobalt0s commented Apr 14, 2026

Description

Added support to remove the subscription.

Live Test

At the end of execution the subscription will be automatically removed using this new functionality.

> TEST Subscribe/Write/Recieve
============== Starting Webhook Handler ==================
Starting webhook server on :4550
Run ngrok with command: `ngrok http 4550`
Local webhook server started at: "http://localhost:4550"
Env variable is missing "WEBHOOK_URL"
Please provide the public URL (e.g., from ngrok) that tunnels to this local server.
Public Webhook URL (empty string to cancel): https://f748-46-150-81-5.ngrok-free.app
Webhook URL: "https://f748-46-150-81-5.ngrok-free.app"
============== Invoking connector.Subscribe() ==================
{}
{
  "me/events": {
    "Events": [
      "create",
      "delete"
    ],
    "PassThroughEvents": [],
    "WatchFields": [],
    "WatchFieldsAll": false
  }
}
============== Invoking connector.Write/Delete() ==================
Creating object me/events:
{
  "Data": {
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('ae87552f-48fc-4dec-9322-65040bf9fdfd')/events/$entity",
    "@odata.etag": "W/\"fIY9UbXetEik54DbN4n/UQABNcwxvw==\"",
    "allowNewTimeProposals": true,
    "attendees": [],
    "bodyPreview": "",
    "categories": [],
    "changeKey": "fIY9UbXetEik54DbN4n/UQABNcwxvw==",
    "createdDateTime": "2026-05-13T20:21:15.0201475Z",
    "end": {
      "dateTime": "2026-05-13T21:00:00.0000255",
      "timeZone": "UTC"
    },
    "hasAttachments": false,
    "hideAttendees": false,
    "id": "AAMkAGY0YzAwY2ViLWQyODktNDI3NS1iNmY4LTE5YzU0MjI5ZTA4OQBGAAAAAABeMJSlO8qLToz2i2IQ1wsqBwB8hj1Rtd60SKTngNs3if9RAAB-ie_oAAB8hj1Rtd60SKTngNs3if9RAAE10fK_AAA=",
    "importance": "normal",
    "isAllDay": false,
    "isCancelled": false,
    "isDraft": false,
    "isOnlineMeeting": false,
    "isOrganizer": true,
    "isReminderOn": true,
    "lastModifiedDateTime": "2026-05-13T20:21:15.1939782Z",
    "location": {
      "address": {},
      "coordinates": {},
      "displayName": "",
      "locationType": "default",
      "uniqueIdType": "unknown"
    },
    "locations": [],
    "occurrenceId": null,
    "onlineMeeting": null,
    "onlineMeetingProvider": "unknown",
    "onlineMeetingUrl": null,
    "organizer": {
      "emailAddress": {
        "address": "AyanBarua@Ampersand280.onmicrosoft.com",
        "name": "Ayan Barua"
      }
    },
    "originalEndTimeZone": "UTC",
    "originalStartTimeZone": "UTC",
    "recurrence": null,
    "reminderMinutesBeforeStart": 15,
    "responseRequested": true,
    "responseStatus": {
      "response": "organizer",
      "time": "0001-01-01T00:00:00Z"
    },
    "sensitivity": "normal",
    "seriesMasterId": null,
    "showAs": "busy",
    "start": {
      "dateTime": "2026-05-13T20:30:00.0000255",
      "timeZone": "UTC"
    },
    "subject": "Ralph Witting",
    "transactionId": null,
    "type": "singleInstance",
  },
  "Errors": [],
  "RecordId": "AAMkAGY0YzAwY2ViLWQyODktNDI3NS1iNmY4LTE5YzU0MjI5ZTA4OQBGAAAAAABeMJSlO8qLToz2i2IQ1wsqBwB8hj1Rtd60SKTngNs3if9RAAB-ie_oAAB8hj1Rtd60SKTngNs3if9RAAE10fK_AAA=",
  "Success": true
}
Search object me/events by { subject : Ralph Witting }
Updating object me/events:
{
  "Data": {
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('ae87552f-48fc-4dec-9322-65040bf9fdfd')/events/$entity",
    "@odata.etag": "W/\"fIY9UbXetEik54DbN4n/UQABNcwxxA==\"",
    "allowNewTimeProposals": true,
    "attendees": [],
    "bodyPreview": "",
    "categories": [],
    "changeKey": "fIY9UbXetEik54DbN4n/UQABNcwxxA==",
    "createdDateTime": "2026-05-13T20:21:15.0201475Z",
    "end": {
      "dateTime": "2026-05-13T21:00:00.0000255",
      "timeZone": "UTC"
    },
    "hasAttachments": false,
    "hideAttendees": false,
    "id": "AAMkAGY0YzAwY2ViLWQyODktNDI3NS1iNmY4LTE5YzU0MjI5ZTA4OQBGAAAAAABeMJSlO8qLToz2i2IQ1wsqBwB8hj1Rtd60SKTngNs3if9RAAB-ie_oAAB8hj1Rtd60SKTngNs3if9RAAE10fK_AAA=",
    "importance": "normal",
    "isAllDay": false,
    "isCancelled": false,
    "isDraft": false,
    "isOnlineMeeting": false,
    "isOrganizer": true,
    "isReminderOn": true,
    "lastModifiedDateTime": "2026-05-13T20:21:16.5889635Z",
    "location": {
      "address": {},
      "coordinates": {},
      "displayName": "",
      "locationType": "default",
      "uniqueIdType": "unknown"
    },
    "locations": [],
    "occurrenceId": null,
    "onlineMeeting": null,
    "onlineMeetingProvider": "unknown",
    "onlineMeetingUrl": null,
    "organizer": {
      "emailAddress": {
        "address": "AyanBarua@Ampersand280.onmicrosoft.com",
        "name": "Ayan Barua"
      }
    },
    "originalEndTimeZone": "UTC",
    "originalStartTimeZone": "UTC",
    "recurrence": null,
    "reminderMinutesBeforeStart": 15,
    "responseRequested": true,
    "responseStatus": {
      "response": "organizer",
      "time": "0001-01-01T00:00:00Z"
    },
    "sensitivity": "normal",
    "seriesMasterId": null,
    "showAs": "busy",
    "start": {
      "dateTime": "2026-05-13T20:30:00.0000255",
      "timeZone": "UTC"
    },
    "subject": "Drake Wisoky",
    "transactionId": null,
    "type": "singleInstance",
  },
  "Errors": [],
  "RecordId": "AAMkAGY0YzAwY2ViLWQyODktNDI3NS1iNmY4LTE5YzU0MjI5ZTA4OQBGAAAAAABeMJSlO8qLToz2i2IQ1wsqBwB8hj1Rtd60SKTngNs3if9RAAB-ie_oAAB8hj1Rtd60SKTngNs3if9RAAE10fK_AAA=",
  "Success": true
}
Search object me/events by { subject : Drake Wisoky }
Deleting object me/events:
... object deleted.
============== Waiting for 2 webhook messages ==================
[1/2] Received webhook message:
{
  "value": [
    {
      "changeType": "created",
      "clientState": "me/events",
      "resource": "Users/ae87552f-48fc-4dec-9322-65040bf9fdfd/Events/AAMkAGY0YzAwY2ViLWQyODktNDI3NS1iNmY4LTE5YzU0MjI5ZTA4OQBGAAAAAABeMJSlO8qLToz2i2IQ1wsqBwB8hj1Rtd60SKTngNs3if9RAAB-ie_oAAB8hj1Rtd60SKTngNs3if9RAAE10fK_AAA=",
      "resourceData": {
        "@odata.etag": "W/\"DwAAABYAAAB8hj1Rtd60SKTngNs3if9RAAE1zDG/\"",
        "@odata.id": "Users/ae87552f-48fc-4dec-9322-65040bf9fdfd/Events/AAMkAGY0YzAwY2ViLWQyODktNDI3NS1iNmY4LTE5YzU0MjI5ZTA4OQBGAAAAAABeMJSlO8qLToz2i2IQ1wsqBwB8hj1Rtd60SKTngNs3if9RAAB-ie_oAAB8hj1Rtd60SKTngNs3if9RAAE10fK_AAA=",
        "@odata.type": "#Microsoft.Graph.Event",
        "id": "AAMkAGY0YzAwY2ViLWQyODktNDI3NS1iNmY4LTE5YzU0MjI5ZTA4OQBGAAAAAABeMJSlO8qLToz2i2IQ1wsqBwB8hj1Rtd60SKTngNs3if9RAAB-ie_oAAB8hj1Rtd60SKTngNs3if9RAAE10fK_AAA="
      },
      "subscriptionExpirationDateTime": "2026-05-14T01:21:12.1745538+00:00",
      "subscriptionId": "1992515e-173c-43ff-9fc3-5e261d691398",
      "tenantId": "5c6241d0-74cc-48a2-b667-3eb0d738af72"
    }
  ]
}
[2/2] Received webhook message:
{
  "value": [
    {
      "changeType": "deleted",
      "clientState": "me/events",
      "resource": "Users/ae87552f-48fc-4dec-9322-65040bf9fdfd/Events/AAMkAGY0YzAwY2ViLWQyODktNDI3NS1iNmY4LTE5YzU0MjI5ZTA4OQBGAAAAAABeMJSlO8qLToz2i2IQ1wsqBwB8hj1Rtd60SKTngNs3if9RAAB-ie_oAAB8hj1Rtd60SKTngNs3if9RAAE10fK_AAA=",
      "resourceData": {
        "@odata.etag": "W/\"CQAAAA==\"",
        "@odata.id": "Users/ae87552f-48fc-4dec-9322-65040bf9fdfd/Events/AAMkAGY0YzAwY2ViLWQyODktNDI3NS1iNmY4LTE5YzU0MjI5ZTA4OQBGAAAAAABeMJSlO8qLToz2i2IQ1wsqBwB8hj1Rtd60SKTngNs3if9RAAB-ie_oAAB8hj1Rtd60SKTngNs3if9RAAE10fK_AAA=",
        "@odata.type": "#Microsoft.Graph.Event",
        "id": "AAMkAGY0YzAwY2ViLWQyODktNDI3NS1iNmY4LTE5YzU0MjI5ZTA4OQBGAAAAAABeMJSlO8qLToz2i2IQ1wsqBwB8hj1Rtd60SKTngNs3if9RAAB-ie_oAAB8hj1Rtd60SKTngNs3if9RAAE10fK_AAA="
      },
      "subscriptionExpirationDateTime": "2026-05-14T01:21:12.1745538+00:00",
      "subscriptionId": "1992515e-173c-43ff-9fc3-5e261d691398",
      "tenantId": "5c6241d0-74cc-48a2-b667-3eb0d738af72"
    }
  ]
}
============== Done ==================
[CLEANUP] Removing subscription.
[CLEANUP] Subscription removed.
=> Shutting down webhook handler
=> completed

@linear
Copy link
Copy Markdown

linear Bot commented Apr 14, 2026

@Cobalt0s Cobalt0s self-assigned this Apr 14, 2026
@Cobalt0s Cobalt0s changed the base branch from cobalt0s/microsoft-subscribe-update to graphite-base/2880 May 1, 2026 00:11
@Cobalt0s Cobalt0s force-pushed the cobalt0s/microsoft-subscribe-delete branch from 5f058a2 to d2d389c Compare May 1, 2026 00:11
@Cobalt0s Cobalt0s force-pushed the graphite-base/2880 branch from 1289e81 to f145e5c Compare May 1, 2026 15:33
@Cobalt0s Cobalt0s force-pushed the cobalt0s/microsoft-subscribe-delete branch from d2d389c to bf65ef9 Compare May 1, 2026 15:33
@Cobalt0s Cobalt0s changed the base branch from graphite-base/2880 to cobalt0s/microsoft-subscribe-create May 1, 2026 15:34
@Cobalt0s Cobalt0s force-pushed the cobalt0s/microsoft-subscribe-create branch from f145e5c to f9b7354 Compare May 1, 2026 17:33
@Cobalt0s Cobalt0s force-pushed the cobalt0s/microsoft-subscribe-delete branch from bf65ef9 to 571054f Compare May 1, 2026 17:33
@Cobalt0s Cobalt0s force-pushed the cobalt0s/microsoft-subscribe-create branch from f9b7354 to 920f377 Compare May 1, 2026 21:58
@Cobalt0s Cobalt0s force-pushed the cobalt0s/microsoft-subscribe-delete branch from 571054f to 353a035 Compare May 1, 2026 21:58
@Cobalt0s Cobalt0s marked this pull request as ready for review May 13, 2026 20:24
@Cobalt0s Cobalt0s force-pushed the cobalt0s/microsoft-subscribe-delete branch from 353a035 to d87e1ab Compare May 13, 2026 21:33
@Cobalt0s Cobalt0s force-pushed the cobalt0s/microsoft-subscribe-create branch from 920f377 to 8adbb04 Compare May 13, 2026 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant