Skip to content

fix(services/baidu-netdisk): preserve root and reject URI authority - #9630

Merged
Xuanwo merged 1 commit into
mainfrom
xuanwo/baidu-path-validation
Dec 4, 2026
Merged

Xuanwo merged 1 commit into
mainfrom
xuanwo/baidu-path-validation

Conversation

@Xuanwo

@Xuanwo Xuanwo commented Dec 3, 2026

Copy link
Copy Markdown
Member

Which issue does this PR close?

Closes #9552.

Rationale for this change

Baidu Netdisk uses numeric list offsets. Deleting children as pages arrive can shift those offsets and skip entries. Discarding the URI authority can also silently accept a misconfigured URI when the remaining path is valid.

What changes are included in this PR?

Finish listing root children before sending exact-path deletes. Reuse the service's single-target delete so each response is checked individually. Local contract tests exercise the public operator methods with an in-process transport. The pagination case lists 1,001 children and checks from a parent operator that the configured root remains and its children are gone. Live Baidu service behavior remains unverified.

Are there any user-facing changes?

Ordinary deletion of / succeeds as a no-op. Recursive deletion of / removes the root's children and preserves the configured directory. Recursive deletion of a named directory removes that directory and its contents.

Use baidu-netdisk:///apps/MyApp/data with the access_token option. Operator::from_uri returns ConfigInvalid for a Baidu Netdisk URI with an authority.

Breaking changes

AI Usage Statement

  • Pi, magpie/codex/gpt-6.2-astra, xhigh. Scoped and coordinated the maintenance change.
  • Pi, magpie/codex/gpt-6.2-astra, high. Traced the public delete and URI construction paths and checked prior evidence.
  • Pi, magpie/codex/gpt-6.2-sol, max. Implemented the service changes and verified the caller contracts locally.
  • Pi, magpie/devin/swe-2-1, high. Independently reran the deletion and URI tests through the public operator and checked the release history.

List all root children before deletion so offsets stay valid. Keep ordinary root deletion a no-op and require an empty URI authority.

Refs #9552
@Xuanwo
Xuanwo requested a review from PsiACE December 3, 2026 23:40
@Xuanwo
Xuanwo merged commit 4148fcc into main Dec 4, 2026
145 checks passed
@Xuanwo
Xuanwo deleted the xuanwo/baidu-path-validation branch December 4, 2026 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(services/baidu-netdisk): guard recursive delete on "/" and reject unexpected URI authority in from_uri

2 participants