Skip to content

SiteMove/Geo move not handled properly during container load#26708

Open
lindsnguyen wants to merge 2 commits intomicrosoft:mainfrom
lindsnguyen:redeemredirect
Open

SiteMove/Geo move not handled properly during container load#26708
lindsnguyen wants to merge 2 commits intomicrosoft:mainfrom
lindsnguyen:redeemredirect

Conversation

@lindsnguyen
Copy link
Contributor

@lindsnguyen lindsnguyen commented Mar 12, 2026

Description

When a site move or geo move triggers a location redirection during container load, the sharing link was not being redeemed against the new (redirected) URL. The redirect itself is handled earlier in the flow, but after the redirect the sharing link is not part of the resolved URL. This means on the subsequent retry at the new location, the sharing link can no longer be redeemed — causing the container load to fail for users who accessed via a sharing link.

fixes https://dev.azure.com/fluidframework/internal/_workitems/edit/58231

Solution

  • On a location redirection error, redeem the sharing link against the redirected URL before re-throwing, so it's already redeemed when the retry happens at the new location.
  • Only attempt redeem if a sharing link is actually present.
  • Treat redeem as best-effort — catch failures and log telemetry (RedirectRedeemFallback / RedirectRedeemFallbackError), always re-throwing the original redirection error so the normal redirect flow continues.
  • Add tests for the no-shareLink and redeem-failure paths.

...getOdspResolvedUrl(error.redirectUrl),
shareLinkInfo: odspResolvedUrl.shareLinkInfo,
};
await redeemSharingLink(redirectedResolvedUrl, storageTokenFetcher, logger);
Copy link
Contributor

Choose a reason for hiding this comment

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

Lets catch the error if it happens and throw the original redirection error otherwise we will swallow the original issue since redeem was just best effort flow. For now you can also add a telemetry event if we come into this flow.

@lindsnguyen lindsnguyen marked this pull request as ready for review March 16, 2026 20:16
Copilot AI review requested due to automatic review settings March 16, 2026 20:16
Copy link
Contributor

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

Fixes ODSP container load failures when site/geo moves trigger location redirection during load by ensuring sharing-link redemption happens against the redirected URL before the retry.

Changes:

  • On locationRedirection errors, attempts to redeem sharingLinkToRedeem against the redirected resolved URL (best-effort) before rethrowing the original redirect error.
  • Adds telemetry for successful fallback (RedirectRedeemFallback) and redemption failures (RedirectRedeemFallbackError).
  • Adds unit tests covering redirect redemption, no-shareLink path, and redeem-failure path.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/drivers/odsp-driver/src/fetchSnapshot.ts Adds redirect-time share link redemption logic and a location-redirection type guard.
packages/drivers/odsp-driver/src/test/fetchSnapshot.spec.ts Adds tests validating redirect redemption behavior and telemetry for success/skip/failure paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants