Skip to content
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

Handle location redirection URL error in getSharingInfo call in odsp driver #21277

Merged
merged 7 commits into from
Jun 13, 2024

Conversation

jatgarg
Copy link
Contributor

@jatgarg jatgarg commented Jun 3, 2024

Description

ADO: https://dev.azure.com/fluidframework/internal/_workitems/edit/8006

After a tenant changes their domain, this leads existing workspaces on the Loop app to stop getting sharing link to the newly created pages. This is because after a redirect, the authorization headers are not sent by the browser. And even if were to just retry with the headers set, SharePoint requires for the auth tokens to be generated for that particular domain.

This PR handle causes the browser to not handle the redirect implicitly by supplying the redirect:manual header in the request and handles the redirect by itself. It will successfully, return the share link to the app.

On the load of the same container, we already have resolveWithLocationRedirectionHandling which handles the redirect during load and also signals the app about the new domain.

Now, I am using the common redirect header instead of prefer header for VROOM Apis as getSharingInfo is not a VROOM api. Redirect header works with all APIs.

@jatgarg jatgarg requested a review from AndreiZe June 3, 2024 17:30
@jatgarg jatgarg self-assigned this Jun 3, 2024
@jatgarg jatgarg requested review from a team, pragya91, markfields, agarwal-navin, tyler-cai-microsoft, kian-thompson and rajatch-ff and removed request for a team June 3, 2024 17:30
@github-actions github-actions bot added base: main PRs targeted against main branch area: driver Driver related issues area: odsp-driver labels Jun 3, 2024
@jatgarg jatgarg requested a review from vladsud June 3, 2024 17:33
@jatgarg jatgarg changed the title Handle location redirection URl in getSharinkgInfo call in odsp driver Handle location redirection URL error in getSharingInfo call in odsp driver Jun 3, 2024
packages/drivers/odsp-driver/src/getFileLink.ts Outdated Show resolved Hide resolved
packages/drivers/odsp-driver/src/getFileLink.ts Outdated Show resolved Hide resolved
packages/drivers/odsp-driver/src/getFileLink.ts Outdated Show resolved Hide resolved
packages/drivers/odsp-driver/src/getFileLink.ts Outdated Show resolved Hide resolved
packages/drivers/odsp-driver/src/test/getFileLink.spec.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@vladsud vladsud left a comment

Choose a reason for hiding this comment

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

I left some number of comments, but it would be great for @AndreiZe to sign off too before it gets merged

@msfluid-bot
Copy link
Collaborator

msfluid-bot commented Jun 13, 2024

@fluid-example/bundle-size-tests: +355 Bytes
Metric NameBaseline SizeCompare SizeSize Diff
aqueduct.js 457.66 KB 457.66 KB No change
azureClient.js 558.43 KB 558.43 KB No change
connectionState.js 680 Bytes 680 Bytes No change
containerRuntime.js 260.13 KB 260.13 KB No change
fluidFramework.js 369.57 KB 369.57 KB No change
loader.js 135.12 KB 135.12 KB No change
map.js 39.83 KB 39.83 KB No change
matrix.js 142.48 KB 142.48 KB No change
odspClient.js 526.33 KB 526.44 KB +118 Bytes
odspDriver.js 98.29 KB 98.41 KB +118 Bytes
odspPrefetchSnapshot.js 42.11 KB 42.23 KB +119 Bytes
sharedString.js 159.28 KB 159.28 KB No change
sharedTree.js 369.56 KB 369.56 KB No change
Total Size 3.23 MB 3.23 MB +355 Bytes

Baseline commit: 8f8728f

Generated by 🚫 dangerJS against 84c7b00

Copy link
Contributor

@AndreiZe AndreiZe left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions bot added the public api change Changes to a public API label Jun 13, 2024
@github-actions github-actions bot removed the public api change Changes to a public API label Jun 13, 2024
@jatgarg jatgarg merged commit a584932 into microsoft:main Jun 13, 2024
30 checks passed
@jatgarg jatgarg deleted the redirect branch June 13, 2024 21:22
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.

5 participants