The process of building custom applications and tools that interact with Microsoft SharePoint, including SharePoint Online in Microsoft 365.
I have conducted some research and to directly answer your concern:
1/ Is it expected that cTag changes for metadata-only updates such as rename or move?
Yes, in practice, this an expected behavior, specifically for SharePoint and OneDrive for Business.
While the conceptual documentation often states:
-
eTag(Entity Tag): Represents the entire item (Content + Metadata). -
cTag(Content Tag): Represents just the content.
In reality, the underlying SharePoint storage engine often treats a file move or rename as an operation that creates a new version of the item or updates the internal container wrapper. Because of how tightly SharePoint couples this data, operations like renaming a file, moving it, or even sometimes updating custom columns will trigger an update to the underlying item version, which causes both the eTag and the cTag to change.
This means cTag is ultimately unreliable as a strict "content-only" change indicator in SharePoint environments.
2. How to reliably distinguish content changes from metadata changes?
Technically, since you cannot rely on cTag alone, the recommended and most robust way to detect actual binary content changes in a Delta query is to use File Hashes.
Every driveItem that is a file includes a file facet in the Graph API response, which contains a hashes object.
- For SharePoint / OneDrive for Business: You should check the
quickXorHash. - For OneDrive Personal: You would typically look at the
sha1Hashorsha256Hash.
You can read here for more information: hashes resource type
3/ The recommended Delta Processing Logic:
When you process your delta responses, you should maintain a local state of both the file's metadata and its quickXorHash.
When an item appears in your Delta response, apply the following logic:
- Compare the Hash (
file.hashes.quickXorHash):- If the new hash differs from your stored hash, the binary content of the file has physically changed. You need to re-download or process the new file content.
- If the new hash is exactly the same, you can guarantee that the file's binary content has not changed.
- Check for Metadata/Move/Rename Operations:
- If the hash is identical (no content change), but the item came back in the delta response, it was a metadata change.
- You can then compare the newly returned
nameandparentReference.idagainst your stored state. - If
namechanged > It was a rename. IfparentReference.idchanged > It was moved to a different folder.
Hope my answer will help you
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.