The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 12:15 UTC
fix(web): track switch no longer blocked when Local environment is off (#32048)
Julius Marminge committed
Nov 14, 2026 at 18:48 UTC
e1458f25e2b16397e171bd88d58a9d0ca8d8003e
3 files changed
+22
-6
apps/web/src/components/settings/UpdateTrackSwitchDialog.tsx
+2
@@ -7,6 +7,7 @@ import { useState } from "react";
7
import { AsyncResult } from "effect/reactivity";
8
9
import { APP_VERSION } from "~/branding";
10
+import { isLocalEnvironmentDisabled } from "~/localEnvironment";
11
import { useDesktopUpdateState } from "~/state/desktopUpdate";
12
import { useEnvironments } from "~/state/environments";
13
import { npmReleaseAtom, npmReleaseFailureMessage } from "~/state/npmRelease";
@@ -104,6 +105,7 @@ function SwitchPlan({
105
databaseMigration: environment.serverConfig?.environment.databaseMigration,
106
})),
107
window.desktopBridge?.getLocalEnvironmentBootstraps().length ?? 0,
108
+ !isLocalEnvironmentDisabled(),
109
);
110
111
const run = async () => {
apps/web/src/components/sidebar/updateEverything.logic.test.ts
+16
-4
@@ -254,7 +254,7 @@ describe("localSwitchBlockReason", () => {
254
const nightly = "0.1.4-nightly.20261027.3796";
255
256
const windows = { connected: true, databaseMigration: 69 };
257
- expect(localSwitchBlockReason(nightly, stable, [windows], 1)).toBeNull();
257
+ expect(localSwitchBlockReason(nightly, stable, [windows], 1, true)).toBeNull();
258
// A WSL server's newer migration blocks the reinstall that would restart it.
259
expect(
260
localSwitchBlockReason(
@@ -262,17 +262,29 @@ describe("localSwitchBlockReason", () => {
262
stable,
263
[windows, { connected: true, databaseMigration: 72 }],
264
2,
265
+ true,
266
),
267
).toContain("does not support yet");
268
// A WSL backend still starting has no client entry, so its database is unchecked.
268
- expect(localSwitchBlockReason(nightly, stable, [windows], 2)).toBe(
269
+ expect(localSwitchBlockReason(nightly, stable, [windows], 2, true)).toBe(
270
"its server is not connected, so its database cannot be checked",
271
);
272
// A cached head from a disconnected server proves nothing.
273
expect(
273
- localSwitchBlockReason(nightly, stable, [{ connected: false, databaseMigration: 69 }], 1),
274
+ localSwitchBlockReason(
275
+ nightly,
276
+ stable,
277
+ [{ connected: false, databaseMigration: 69 }],
278
+ 1,
279
+ true,
280
+ ),
281
).toBe("its server is not connected, so its database cannot be checked");
275
- expect(localSwitchBlockReason("0.1.3", stable, [], 1)).toBeNull();
282
+ expect(localSwitchBlockReason("0.1.3", stable, [], 1, true)).toBeNull();
283
+ // A primary backend still starting has no entry or bootstrap yet, unless Local environment is off.
284
+ expect(localSwitchBlockReason(nightly, stable, [], 0, true)).toBe(
285
+ "its server is not connected, so its database cannot be checked",
286
+ );
287
+ expect(localSwitchBlockReason(nightly, stable, [], 0, false)).toBeNull();
288
});
289
});
290
apps/web/src/components/sidebar/updateEverything.logic.ts
+4
-2
@@ -176,7 +176,8 @@ function channelSwitchBlockReason(
176
177
/** This app's reinstall restarts every server it hosts, so each of their databases must allow the
178
* switch. `backendCount` is the desktop's own inventory: a backend still starting has no client
179
- * entry yet. A cached config can outlive its connection, so only a connected server's head counts. */
179
+ * entry yet. A cached config can outlive its connection, so only a connected server's head counts.
180
+ * With Local environment off this app runs no server, so its reinstall restarts none. */
181
export function localSwitchBlockReason(
182
appVersion: string,
183
release: ChannelSwitchRelease,
@@ -185,8 +186,9 @@ export function localSwitchBlockReason(
186
readonly databaseMigration: number | undefined;
187
}>,
188
backendCount: number,
189
+ localEnvironmentEnabled: boolean,
190
): string | null {
189
- if (!crossesTrack(appVersion, release)) return null;
191
+ if (!localEnvironmentEnabled || !crossesTrack(appVersion, release)) return null;
192
if (
193
hosted.length === 0 ||
194
hosted.length < backendCount ||