Skip to content

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

Open
emliunix wants to merge 2 commits into
apache:mainfrom
emliunix:main
Open

fix(services/onedrive): fix url of onedrive_create_upload_session#7257
emliunix wants to merge 2 commits into
apache: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

Copilot AI left a comment

Copy link
Copy Markdown

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 thread core/services/onedrive/src/core.rs
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Jun 16, 2026
@emliunix emliunix force-pushed the main branch 2 times, most recently from 6738dcf to c8ce885 Compare June 17, 2026 09:32
@emliunix emliunix requested a review from Copilot June 17, 2026 09:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

Comment on lines +134 to +137
pub struct FileUploadItem {
#[serde(rename = "@microsoft.graph.conflictBehavior")]
conflict_behavior: String,
name: String,
pub conflict_behavior: String,
pub name: String,
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct OneDriveUploadSessionCreationRequestBody {
item: FileUploadItem,
pub item: FileUploadItem,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There's no opendal core API can take these structs, so it's safe. And also making them pub actually follows the convention of the other models in the same file.


use super::*;

fn get_request_json_body<T: for<'a> Deserialize<'a>>(request: Request<Buffer>) -> T {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it's in test only, and on the contrary, to change it to DeserializeOwned is a production code change which has larger change surface.

@emliunix

Copy link
Copy Markdown
Contributor Author

@Xuanwo When you get a chance, please take a look at this PR. It fixes the big file upload bug, and I have refined the PR with tests as suggested. Or maybe I can refine the PR further if there're more input.

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:M This PR changes 30-99 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