Inconsistency with '@microsoft.graph.sharedChanged' Property During OneDrive Delta Queries after Sharing Link Expiry Modification
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
- Sign-in to a OneDrive for Business account and create a file
- 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
- Notice how all files from that drive are returned. Take note of the
@odata.deltaLink
property that's returned.
- Notice how all files from that drive are returned. Take note of the
- In OneDrive, share the file you've created in step 1, specify an expiry date for that sharing link you're creating
- Follow the delta link provided by the GET query from step 2
- 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. - Take note of the
@odata.deltaLink
property that's returned
- Notice how the item you've previously shared in step 3 is returned in the delta feed with the attribute
- In OneDrive, change the expiration date of the sharing link you've created in step 3
- Follow the delta link provided by the GET query from step 4.
- Notice how the file for which you changed a sharing link permission expiration date is returned, indicating a change.
- Notice how the property
"@microsoft.graph.sharedChanged": true
is absent from that file.
Thanks for your time!