Inconsistent response while fetching Drive Changes using DeltaLink when a file checkout is discarded.

Raj Poladia 1 Reputation point
2022-09-22T12:45:13.227+00:00

We are using DeltaLink to fetch the file changes in Document Library (Drive). We are getting file which was not actually changed in response. The file was checked out first and the checkout was discarded later hence, the file was not actually changed. Despite file not getting changed it was part of changes fetched using Delta Link.

Steps to reproduce:

  1. Get the Latest Delta Link for the drive with some files in it API: https://graph.microsoft.com/v1.0/drives/{driveId}/root/delta?token=latest
  2. Checkout a file in Drive manually or programmatically API: https://graph.microsoft.com/v1.0/drives/{driveId}/items/{itemId}/checkout
  3. Discard the checkout on the file manually or programmatically API: {SiteUrl}/_api/web/lists('{ListId}')/items(ListItemId)/file/undocheckout()
  4. Fetch the Drive changes using Delta Link fetched API: https://graph.microsoft.com/v1.0/drives/{driveId}/root/delta?token={DeltaToken}

Response received using delta link contains the file whose checkout was discarded, in other words the file was not actually changed and is still getting listed.

Expected behavior:
In case the checkout was discarded (the file was not actually changed) it should not be listed as part of response received using DeltaLink.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,836 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,868 questions
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 32,166 Reputation points Microsoft Vendor
    2022-09-23T08:33:48.253+00:00

    Hi @Raj Poladia
    Per my test, I can get the same result as yours. The delta feed shows the latest state for each item, not each change. So when you check out and check in an item, it's state has been changed althought we didn't edit the content of the item. It will be listed as part of response. More details for reference
    https://learn.microsoft.com/en-us/graph/api/driveitem-delta?view=graph-rest-1.0&tabs=http#remarks


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.