microsoftgraph / msgraph-sdk-typescript

MIT License
21 stars 3 forks source link

Exception encountered when parsing response after deleting an existing Sharepoint item within a Document Library list #545

Closed Caspidev closed 5 months ago

Caspidev commented 5 months ago

I encountered an exception while working with the SDK. Here are the details:

The exception occurs only after deleting an existing item. Adding items works perfectly fine. When moving items, only creation events are received. The exception arises when trying to parse the response received after making a call to the following endpoint:

deltaDetails = await client.api(https://graph.microsoft.com/v1.0/sites/xxxxx.sharepoint.com,xxx-xxx-xxx-xxx-xxxxxx-xxx-xx-xxx-xxx/lists/xxx-xxx-xxx-xxx-xxx/items/delta?token=xxx)).get();

To further investigate, I tried accessing the endpoint using Postman with the access token. Here's the error I received:

{
  "@odata.context": "xxx",
  "@odata.deltaLink": "xxx",
  "value": [
    {
      "error": {
        "code": "InternalServerError",
        "message": "Cannot write a deleted resource, link, deleted link, or nested delta resource set within a resource set; they must be written within a delta resource set.",
        "innerError": {
          "date": "2024-04-08T16:25:28",
          "request-id": "b0deb864-f18e-47fb-9a24-08a614f0eaee",
          "client-request-id": "b0deb864-f18e-47fb-9a24-08a614f0eaee"
        }
      }
    }
  ]
}

This error seems to indicate an issue with writing a deleted resource or link within a resource set. Any insights or guidance on resolving this issue would be greatly appreciated.