The current behavior of the Microsoft Graph API when copying folders does indeed lead to issues when some files within the folder have insufficient permissions. As you noted, the entire copy operation fails without providing detailed feedback on which items were successfully copied and which were not. This can create confusion for users and developers alike, as they receive a generic error message without insight into the operation's partial success.
Your expectations for improved behavior are valid. Ideally, the API should support partial success reporting, allowing for a more granular understanding of the copy operation's results. This could be implemented in several ways:
- Detailed Response: The API could return a structured response indicating which files succeeded and which failed, similar to how batch requests are handled.
- 207 Multi-Status Response: The API could continue copying all accessible items and return a response that details the status of each item, allowing users to see what was copied successfully.
- Optional Parameter: Introducing a query parameter like
?continueOnError=truecould enable best-effort copying, providing users with the flexibility to manage permissions dynamically.
These enhancements would significantly improve the usability of the folder copy operation in scenarios where permissions vary across files, ultimately leading to a better experience for users and developers.