The process of building custom applications and tools that interact with Microsoft SharePoint, including SharePoint Online in Microsoft 365.
Hi Kevin Zhu,
Welcome to Microsoft Q&A Forum!
Have a good day and I hope you're doing well!
I completely understand your concern. Seeing files appear in the Delta API response when their content hasn't physically changed can indeed be confusing and may lead to redundant processing for end-users.
Based on my research and testing in the virtual environment, I was able to reproduce the behavior you described. Here is what I found regarding why this happens and how to handle it.
The Microsoft Graph Delta API is designed to track changes to the DriveItem entity as a whole. A DriveItem includes both the File Content and its Metadata (such as Title, Description, or even system-triggered property updates).
- eTag: Represents the state of the entire item (Metadata + Content). Any change to the item, even a background system update or a metadata edit, will change the eTag.
- cTag (Content Tag): Represents the state of the content specifically. This value only changes when the actual binary stream of the file is modified.
I performed a test using a text file to isolate metadata changes from content changes.
- I uploaded a file named abcd.txt.
- I updated only the "Title" property of the file via SharePoint Online (without opening or editing the file content).
- I queried the Delta API again.
The result: The API returned the file as "changed".
The eTag changed (indicating the Item was updated).
However, the cTag and Size remained exactly the same (indicating the Content is unchanged)
To prevent confusion for your end-users and avoid unnecessary file downloads, I recommend adding a logic check on your client side:
When processing the Delta response, compare the cTag of the incoming item with the cTag you have stored locally.
- If cTag is different: The file content has changed. Trigger a download/sync.
- If cTag is the same (but eTag changed): It is likely a metadata or system update. You can safely ignore this for content synchronization purposes.
I hope the information provided gives you some helpful insights into this issue. If you have any concerns or questions, or if I have misunderstood your scenario or left anything unclear, please feel free to reach out.
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.