Skip to content

fix(services/onedrive): fix url of onedrive_create_upload_session#7257

Open
emliunix wants to merge 1 commit intoapache:mainfrom
emliunix:main
Open

fix(services/onedrive): fix url of onedrive_create_upload_session#7257
emliunix wants to merge 1 commit intoapache:mainfrom
emliunix:main

Conversation

@emliunix
Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes #7256

Rationale for this change

To fix the bug

What changes are included in this PR?

change upload session url to include filename

Are there any user-facing changes?

no

AI Usage Statement

by hand

NOTE

Need to test

@emliunix emliunix marked this pull request as ready for review March 20, 2026 21:54
@emliunix emliunix requested a review from Xuanwo as a code owner March 20, 2026 21:54
Copilot AI review requested due to automatic review settings March 20, 2026 21:54
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. releases-note/fix The PR fixes a bug or has a title that begins with "fix" labels Mar 20, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes OneDrive large-file (chunked) upload failures by correcting the createUploadSession endpoint to target the full file path (including filename), aligning the URL path with the request body’s item.name.

Changes:

  • Update onedrive_create_upload_session to build the upload session URL from the full path instead of the parent directory.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 385 to 389
let file_name = get_basename(path);
let url = format!(
"{}:/createUploadSession",
self.onedrive_item_url(parent_path, true),
self.onedrive_item_url(path, true),
);
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a regression unit test for onedrive_create_upload_session URL construction to ensure the generated endpoint includes the full file path (including filename) and stays consistent with the item.name sent in the request body. This would prevent reintroducing the previous 400 "Name from path does not match name from body" behavior when refactoring URL helpers.

Copilot uses AI. Check for mistakes.
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:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: onedrive big file write failure

2 participants