Skip to content

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

Merged
merged 5 commits into from
Jun 9, 2025

Conversation

ruchika-m
Copy link
Contributor

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 / after root:.

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

@Copilot Copilot AI review requested due to automatic review settings June 5, 2025 16:59
@github-actions github-actions bot added base: main PRs targeted against main branch area: driver Driver related issues area: odsp-driver labels Jun 5, 2025
Copy link
Contributor

@Copilot 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

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 after root:.
}/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}

@jatgarg jatgarg closed this Jun 9, 2025
@jatgarg jatgarg reopened this Jun 9, 2025
@Abe27342
Copy link
Contributor

Abe27342 commented Jun 9, 2025

/azp run Build - protocol-definitions,Build - test-tools,server-gitrest,server-gitssh,server-historian,server-routerlicious,Build - client packages,repo-policy-check

@Abe27342
Copy link
Contributor

Abe27342 commented Jun 9, 2025

/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

Copy link

Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@Abe27342 Abe27342 enabled auto-merge (squash) June 9, 2025 18:40
@Abe27342 Abe27342 merged commit d9b1258 into microsoft:main Jun 9, 2025
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: driver Driver related issues area: odsp-driver base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants