fix(services/onedrive): fix url of onedrive_create_upload_session#7257
fix(services/onedrive): fix url of onedrive_create_upload_session#7257emliunix wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
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_sessionto build the upload session URL from the fullpathinstead of the parent directory.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
6738dcf to
c8ce885
Compare
| 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, |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
it's in test only, and on the contrary, to change it to DeserializeOwned is a production code change which has larger change surface.
|
@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. |
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