Fix Cloud Run desktop handoff den base URL#1822
Open
devcool20 wants to merge 1 commit into
Open
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
@devcool20 is attempting to deploy a commit to the Different AI Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
denBaseUrlresolution for Google Cloud Run web origins.*.run.appweb hosts, which makes Cloud Run handoff links include/api/den.DEN_DESKTOP_HANDOFF_WEB_HOSTSfor self-hosted/custom domains that also need/api/den.Issue
Closes #1807
Root cause
resolveDesktopDenBaseUrl()only treated hardcoded OpenWork app hosts,app.*, and local/private hosts as web app hosts. Cloud Run frontend origins like:https://den-web-123.us-central1.run.appdid not match that allowlist, so the generated desktop deep link used:
denBaseUrl=https://den-web-123.us-central1.run.appThe desktop app then called:
/v1/auth/desktop-handoff/exchangeon the web frontend instead of:
/api/den/v1/auth/desktop-handoff/exchangeExpected behavior
For a Cloud Run web origin, the generated handoff URL should include:
denBaseUrl=https://den-web-123.us-central1.run.app/api/denTesting
bun test ee/apps/den-api/test/desktop-handoff-url.test.tsgit diff --checkresolveDesktopDenBaseUrl()helper.origin=https://den-web-123.us-central1.run.app.https://den-web-123.us-central1.run.app/api/den.Notes
pnpm --filter @openwork-ee/den-api buildcould not complete locally because this workspace install cannot resolvestripefromsrc/stripe-billing.ts.bun test ee/apps/den-api/testhits the same existingstripemodule-load failure in unrelated tests.