Skip to content

fix(services/onedrive): build correct children URL when listing root#7720

Open
tonghuaroot wants to merge 1 commit into
apache:mainfrom
tonghuaroot:fix-onedrive-root-list
Open

fix(services/onedrive): build correct children URL when listing root#7720
tonghuaroot wants to merge 1 commit into
apache:mainfrom
tonghuaroot:fix-onedrive-root-list

Conversation

@tonghuaroot

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes #7102.

Rationale for this change

Listing the drive root builds the URL as root:/children, which Graph API interprets as a path-addressed item named "children" instead of the root's children listing. The request returns 404, which the lister swallows, so list("/") returns an empty result.

A previous attempt (#7114) went stale. This PR follows the approach suggested in its review: split the API into onedrive_list_request() and onedrive_list(), so the generated request can be asserted directly in unit tests.

What changes are included in this PR?

  • Add OneDriveCore::onedrive_list_request() / onedrive_list(). The drive root is addressed as root/children; other paths keep the path-based root:/path:/children form.
  • OneDriveLister now calls onedrive_list() for the first page instead of building the URL inline.
  • Unit tests asserting the generated request URLs (root, nested path, custom root), plus a mocked end-to-end list test through oio::PageLister that fails against the previous behavior.

Are there any user-facing changes?

op.list("/") on OneDrive now returns the root directory's entries instead of an empty result. No API changes.

AI Usage Statement

This PR was developed with the assistance of Claude Code (Opus 4.8). The fix and tests were reviewed, verified, and tested by me.

@tonghuaroot tonghuaroot requested a review from Xuanwo as a code owner June 10, 2026 08:26
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. releases-note/fix The PR fixes a bug or has a title that begins with "fix" labels Jun 10, 2026
@tonghuaroot

Copy link
Copy Markdown
Contributor Author

The failing sftp behavior test is a Docker Hub pull timeout (registry-1.docker.io: context deadline exceeded), unrelated to this change. Could a maintainer retrigger the job?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

releases-note/fix The PR fixes a bug or has a title that begins with "fix" size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Onedrive service list("/") returns empty result due to incorrect URL construction

1 participant