Conversation
added 2 commits
October 2, 2026 11:33
…er shortcuts
When users add shared folders to their OneDrive via official "Add shortcut to My files",
the root item returned by Microsoft Graph API contains a remoteItem facet rather than a
standard native folder facet.
Previously, attempting to access subdirectories or files within such shortcuts resulted in
422 Unprocessable Entity ("Children cannot be listed from an item that is not a folder")
or 404 ItemNotFound because requests were addressed directly against /me/drive/root.
This change:
- Resolves remoteItem ancestor targets in paths to query the target drive scope
via /drives/{driveId}/items/{itemId}:{subPath}:/children.
- Enables multi-level recursive navigation and pagination across all shortcut subfolders.
- Properly resolves direct download links for nested files inside shared shortcuts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary / 摘要
When users add shared folders to their OneDrive via official "Add shortcut to My files", the root item returned by Microsoft Graph API contains a
emoteItem facet rather than a standard native folder facet.
Previously, attempting to access subdirectories or files within such shortcuts resulted in:
This change:
Resolves remoteItem ancestor targets in paths to query the target drive scope via /drives/{driveId}/items/{itemId}:{subPath}:/children.
Enables multi-level recursive navigation and pagination across all shortcut subfolders.
Properly resolves direct download links for nested files inside shared shortcuts.
This PR has breaking changes. / 此 PR 包含破坏性变更。
This PR changes public API, config, storage format, or migration behavior. / 此 PR 修改了公开 API、配置、存储格式或迁移行为。
This PR requires corresponding changes in related repositories. / 此 PR 需要关联仓库同步修改。
Testing / 测试
Checklist / 检查清单
AI Disclosure / AI 使用声明
Tools used / 使用工具:
Usage scope / 使用范围:
Assisted in analyzing Microsoft Graph API remoteItem responses and implementing recursive drive path resolution.