[codex] Fix hosted channel bootstrap#2613
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ApprovabilityVerdict: Approved This is a targeted fix ensuring hosted channel deployments (nightly/latest) are properly detected as static apps, with corresponding nightly brand assets support. The changes are well-tested, limited in scope, and authored by a repository admin. You can customize Macroscope's approvability policy. Learn more. |
Dismissing prior approval to re-evaluate 0422aff
What changed
VITE_HOSTED_APP_CHANNEL=latest|nightlyas hosted static apps when no backend URL is configured.https://nightly.app.t3.codes.Why
The hosted-static guard only recognized the router origin from
VITE_HOSTED_APP_URL(https://app.t3.codes). Direct channel aliases likenightly.app.t3.codesfell through to the primary/local environment bootstrap path, which fetched/.well-known/t3/environmentfrom Vercel. Vercel servedindex.html, and the client tried to parse it as JSON, causingUnexpected token '<', "<!doctype"... is not valid JSON.Validation
bun --filter=@t3tools/web run test -- hostedPairing.test.tsbun fmtbun lintbun typecheckbun run release:smokeNote
Fix hosted channel bootstrap to support nightly and latest release channels
configuredHostedAppChannelin hostedPairing.ts to readVITE_HOSTED_APP_CHANNELfrom env; returns"latest"or"nightly"if set, otherwisenull.isHostedStaticAppto returntruewhen a valid hosted channel is configured and no backend URL is set, instead of relying solely on URL origin matching.resolveWebAssetBrandForChannelin brand-assets.ts mapping"nightly"→"nightly"brand and"latest"→"production", with nightly-specific favicon and icon paths.--channel(defaulting to"latest") toapply-web-brand-assets, so the correct brand assets are applied per channel.Macroscope summarized 0422aff.
Note
Medium Risk
Changes the hosted/static bootstrap decision and Vercel build-time asset selection, which could affect how hosted deployments initialize and display branding across channels. Scope is limited and covered by new unit tests for channel alias handling and asset mapping.
Overview
Fixes hosted-static detection to treat builds with
VITE_HOSTED_APP_CHANNEL(latest/nightly) as hosted static apps when no backend URL is configured, so channel alias domains (e.g.nightly.app.t3.codes) don’t fall into the primary/local bootstrap path.Updates the Vercel build to pass the release channel into
apply-web-brand-assets, expands branding assets to include anightlyweb icon set, and adds tests for the new channel-to-brand mapping and nightly icon overrides.Reviewed by Cursor Bugbot for commit 0422aff. Bugbot is set up for automated code reviews on this repo. Configure here.