Inconsistency with '@microsoft.graph.sharedChanged' Property During OneDrive Delta Queries after Sharing Link Expiry Modification

Arnaud Foulem-Malouin 0 Reputation points
2023-09-27T22:21:49.9866667+00:00

Hello, I hope you're all well!

While working with the OneDrive Graph API, I've come across a perplexing behaviour with the deltashowsharingchanges header and delta queries.

In a nutshell, when scanning drive items in a drive using a delta query, the deltashowsharingchanges header allows the caller to know if an item is part of a delta feed because of a sharing change or not by adding the property "@microsoft.graph.sharedChanged": true to such items.

When changing the expiry date of a sharing link on a drive item, I noticed that this item was indeed returned in the delta feed, indicating a change, but without the property "@microsoft.graph.sharedChanged": true. I would expect that property to be present in that situation.

This is a concern because when I'm scanning for permission changes using delta queries, I am forced to expand permissions on all items returned in the delta feed, regardless of the presence of the sharedChanged property or not because I cannot trust it for changes on sharing links expiry dates.

Is this a known limitation, a bug or am I missing something here?

Steps to reproduce

  1. Sign-in to a OneDrive for Business account and create a file
  2. Ensure you have the proper permissions to do so and query Microsoft Graph with GET https://graph.microsoft.com/v1.0/drives/<DRIVE_ID>/root/delta , replacing <DRIVE_ID> with the ID of the drive in which you just created the file in step 1. Ensure you have the following headers set: prefer : hierarchicalsharing, deltatraversepermissiongaps, deltashowremovedasdeleted, deltashowsharingchanges
    1. Notice how all files from that drive are returned. Take note of the @odata.deltaLink property that's returned.
  3. In OneDrive, share the file you've created in step 1, specify an expiry date for that sharing link you're creating
  4. Follow the delta link provided by the GET query from step 2
    1. Notice how the item you've previously shared in step 3 is returned in the delta feed with the attribute "@microsoft.graph.sharedChanged": true, this ensures that you've done the setup correctly for the following steps.
    2. Take note of the @odata.deltaLink property that's returned
  5. In OneDrive, change the expiration date of the sharing link you've created in step 3
  6. Follow the delta link provided by the GET query from step 4.
    1. Notice how the file for which you changed a sharing link permission expiration date is returned, indicating a change.
    2. Notice how the property "@microsoft.graph.sharedChanged": true is absent from that file.

Thanks for your time!

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,088 questions
OneDrive
OneDrive
A Microsoft file hosting and synchronization service.
1,125 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.