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 1 commit intoapache:mainfrom
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.
| let file_name = get_basename(path); | ||
| let url = format!( | ||
| "{}:/createUploadSession", | ||
| self.onedrive_item_url(parent_path, true), | ||
| self.onedrive_item_url(path, true), | ||
| ); |
There was a problem hiding this comment.
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.
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