-
Notifications
You must be signed in to change notification settings - Fork 549
Fix request url for creating new empty fluid file #24770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Fix the construction of the ODSP “create new empty fluid file” request URL by removing an extra slash after root:
.
- Corrects the URL template to avoid an unintended slash that breaks PFT+POP auth on ODSP.
- No breaking changes; behavior remains the same once the URL is fixed.
Comments suppressed due to low confidence (2)
packages/drivers/odsp-driver/src/createFile/createFile.ts:215
- Add a unit test to validate the constructed request URL for
createNewEmptyFluidFile
, ensuring that the URL matches the expected format without the extra slash afterroot:
.
}/items/root:${filePath}/${encodedFilename}:/content?@name.conflictBehavior=rename&select=id,name,parentReference`
packages/drivers/odsp-driver/src/createFile/createFile.ts:213
- [nitpick] Consider extracting the URL construction into a helper or using a URL builder utility to reduce reliance on complex template literals and improve readability.
const initialUrl = `${getApiRoot(new URL(newFileInfo.siteUrl))}/drives/${newFileInfo.driveId}
/azp run Build - protocol-definitions,Build - test-tools,server-gitrest,server-gitssh,server-historian,server-routerlicious,Build - client packages,repo-policy-check |
/azp run Build - api-markdown-documenter,Build - benchmark-tool,Build - build-common,Build - build-tools,Build - common-utils,Build - eslint-config-fluid,Build - eslint-plugin-fluid |
Azure Pipelines could not run because the pipeline triggers exclude this branch/path. |
Azure Pipelines successfully started running 2 pipeline(s). |
Description
When using PFT+POP auth with ODSP, ODSP fails on the given request url for create new empty fluid file.
We were trying to adopt the change to allow editing newly created file before attaching them on Loop Web Service. When this change was merged last time, it blew up in staging on a delegated token test that creates a page with an image in workspace. Upon investigation, it was determined that the createNewEmptyFluidFile method that we are using makes a request to resource url with an extra slash where it should not exist which makes pft+pop on odsp unhappy.
Problem resource url:
${getApiRoot(new URL(newFileInfo.siteUrl))}/drives/${newFileInfo.driveId}/items/root:/${filePath}/${encodedFilename}:/content?@name.conflictBehavior=rename&select=id,name,parentReference
Fixed resource url:
${getApiRoot(new URL(newFileInfo.siteUrl))}/drives/${newFileInfo.driveId}/items/root:${filePath}/${encodedFilename}:/content?@name.conflictBehavior=rename&select=id,name,parentReference
Notice the
/root:${filePath}
in fixed url which does not have a/
afterroot:
.On office-bohemia we tested this change by patching the FF code and deploying through hotfix branch to confirm that this PR will indeed resolve the problem.
Breaking Changes
None
Reviewer Guidance
None