Open jbyt1 opened 1 year ago
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
@VesaJuvonen any update on triage for this or advice on what to do? Thanks.
We observe the same problem. The recursively copied items are missing both in the GetChanges method and in the GetListItemChangesSinceToken method of the REST API. It seems to be a bug in SharePoint, which is existent in combination with the previously non-existent copy function in the modern UI.
I have had contact with the premium support which is not able to help with this kind of issues. The support assume it's a bug, even if they can't confirm it 100%. The recommendation is to wait here on github for a response. Please look into this, it would be nice to at least get a confirmation that it is a bug.
A official guidance to use those methods for synchronizing can be found here: https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/synchronize-sharepoint-items-using-the-rest-service https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/query-sharepoint-change-log-with-changequery-and-changetoken
A detailed description of the methods is in the Specs. If you take this into account, it must be a bug: The GetListItemChanges operation is used to retrieve the list items that have been inserted or updated after the specified date and time, and that match the specified filter criteria Reference: https://learn.microsoft.com/en-us/openspecs/sharepoint_protocols/ms-listsws/41e46661-0879-46d3-98e5-b23db0e98f29
The GetListItemChangesSinceToken operation is used to return changes made to a specified list after the event expressed by the change token, if specified, or to return all the list items in the list. Reference: https://learn.microsoft.com/en-us/openspecs/sharepoint_protocols/ms-listsws/472fa848-4997-4500-a03f-d2295e127217
Target SharePoint environment
SharePoint Online
What SharePoint development model, framework, SDK or API is this about?
SharePoint REST API
Developer environment
None
What browser(s) / client(s) have you tested
Additional environment details
GetChanges API call done through Postman
Describe the bug / error
Normally adding a folder will include all sub folders and files in the folder as separate changes in the GetChanges response. This doesn't seem to be the case when copying a parent folder in the SharePoint UI. Instead a single change is logged as an add item event. This seems to go against the change log idea with the RecursiveAll set to true. Because of this additional work is required to conditionally scan the folder tree if changes were logged from a copy or manually adding the folder.
Steps to reproduce
Example GetChanges post call query for step 4 https://mytenant.sharepoint.com/sites/mysite/_api/web/lists/getbytitle('mylist')/getchanges
Expected behavior
Any copy method should include changes for any sub folders or files when RecursiveAll is set to true and should match the behaviour of when a user would manually add a folder with subfolders and files. This is to reduce the requirement to perform a tree traversal and hit the API more than necessary.