From 181e21f2d0ea6b931bf43f403e871556471f799e Mon Sep 17 00:00:00 2001 From: Naiyuan Qing <145280634+NevilleQingNY@users.noreply.github.com> Date: Tue, 21 Jul 2026 14:08:23 +0800 Subject: [PATCH] fix(desktop): commit staging env with explicit VITE_APP_URL (MUL-5025) (#5680) * fix(desktop): commit staging env with explicit VITE_APP_URL (MUL-5025) Staging desktop dev relied on a hand-maintained local .env.staging, where the web-origin var was misnamed VITE_WEB_URL. Desktop only reads VITE_APP_URL, so appUrl silently fell back to the API-origin derivation and copy-link URLs pointed at multica-api.copilothub.ai (404). Track apps/desktop/.env.staging with the correct names (mirroring the mobile precedent), and fill in mobile's EXPO_PUBLIC_WEB_URL now that the staging web host is committed rather than living on a teammate's machine. Co-Authored-By: Claude Fable 5 Co-authored-by: multica-agent * chore(desktop): mark staging envs internal, clarify VITE_APP_URL semantics (MUL-5025) Per review: state in both tracked .env.staging files that the staging environment is internal (not a public support target), and spell out that VITE_APP_URL is the web app origin for copy-link/open-in-browser URLs, never the API host. Co-Authored-By: Claude Fable 5 Co-authored-by: multica-agent --------- Co-authored-by: Claude Fable 5 Co-authored-by: multica-agent --- .gitignore | 5 +++++ apps/desktop/.env.staging | 11 +++++++++++ apps/mobile/.env.staging | 7 +++---- 3 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 apps/desktop/.env.staging diff --git a/.gitignore b/.gitignore index 864575245..399acf48d 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,11 @@ dist-electron # Desktop production config is public (backend URL, etc.) — track it so # `pnpm package` produces a release-ready build without extra setup. !apps/desktop/.env.production +# Desktop staging config is public (staging API/web URLs) — track it so +# `pnpm dev:desktop:staging` works from a fresh checkout instead of relying +# on a hand-written local env file (MUL-5025: a misnamed VITE_ var there +# silently broke copy-link URLs). +!apps/desktop/.env.staging # Mobile staging config is public (staging API URL) — track it so a fresh # checkout can run `pnpm dev:mobile:staging` / `ios:mobile*:staging` without # the user having to copy `.env.example` first. diff --git a/apps/desktop/.env.staging b/apps/desktop/.env.staging new file mode 100644 index 000000000..bd28da7c5 --- /dev/null +++ b/apps/desktop/.env.staging @@ -0,0 +1,11 @@ +# Internal staging environment; not a public support environment. +# Used by `pnpm dev:desktop:staging` (`electron-vite dev --mode staging`). +# Personal overrides go in .env.staging.local. +VITE_API_URL=https://multica-api.copilothub.ai + +# VITE_APP_URL is the web app origin used for copy-link/open-in-browser URLs. +# Do not point it at the API host. It must be explicit here: the `api.` +# derivation in shared/runtime-config.ts doesn't match this deployment's +# `multica-api.` naming and would fall back to the API origin +# (MUL-5025). +VITE_APP_URL=https://multica-app.copilothub.ai diff --git a/apps/mobile/.env.staging b/apps/mobile/.env.staging index 16b0fb60b..2679127da 100644 --- a/apps/mobile/.env.staging +++ b/apps/mobile/.env.staging @@ -1,10 +1,9 @@ +# Internal staging environment; not a public support environment. # Used by `pnpm dev:mobile:staging` and the `ios:device:staging[:release]` # scripts. Loaded via `dotenv-cli` (see package.json), NOT by Expo's auto- # loader — Expo only auto-loads .env..local files. EXPO_PUBLIC_API_URL=https://multica-api.copilothub.ai # Optional. Enables "Copy link" / "Open on web" actions in issue / project / -# comment menus. Without it those menu items just don't appear. Fill in the -# staging web host when you have it (canonical value lives in -# apps/desktop/.env.staging on a teammate's machine). -# EXPO_PUBLIC_WEB_URL=https:// +# comment menus. Without it those menu items just don't appear. +EXPO_PUBLIC_WEB_URL=https://multica-app.copilothub.ai