Hi @User3 ,
Welcome to Q&A forum!
Here are the answers to your questions:
- Delta Query Behavior: The behavior you’re experiencing with delta queries is a known characteristic of the API. When multiple operations occur on a file, such as creation followed by deletion, the delta query will reflect only the last state of that file (in this case, deletion). This is because each operation results in a new version or identity for the file in SharePoint Online, and once an operation completes successfully, previous versions are considered unchanged for subsequent requests. There isn’t a native way to retrieve intermediate states within a single delta request.
- Event Ordering: Similarly, event ordering can be tricky when dealing with restore operations from the recycle bin or other similar scenarios where events may seem identical but have different implications (such as delete vs. restore). Currently, there isn’t an inherent mechanism within SharePoint or its APIs to order these events differently based solely on their type.
There is currently no available method to do this, you can investigate customizing the application programming interfaces provided by Microsoft Graph to better suit your specific needs.
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.