The best way to control Claude Code, Codex and more from any computer or phone
fix: don't let un-updateable builds check for an update (#1808)
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Noah Gregory committed
Apr 9, 2026 at 21:27 UTC
5d9eb183123466fdf4b972fe33a4823d089370d3
3 files changed
+50
-11
apps/desktop/src/main.ts
+17
-11
@@ -700,12 +700,15 @@ function dispatchMenuAction(action: string): void {
700
}
701
702
function handleCheckForUpdatesMenuClick(): void {
703
+ const hasUpdateFeedConfig =
704
+ readAppUpdateYml() !== null || Boolean(process.env.T3CODE_DESKTOP_MOCK_UPDATES);
705
const disabledReason = getAutoUpdateDisabledReason({
706
isDevelopment,
707
isPackaged: app.isPackaged,
708
platform: process.platform,
709
appImage: process.env.APPIMAGE,
710
disabledByEnv: process.env.T3CODE_DISABLE_AUTO_UPDATE === "1",
711
+ hasUpdateFeedConfig,
712
});
713
if (disabledReason) {
714
console.info("[desktop-updater] Manual update check requested, but updates are disabled.");
@@ -942,6 +945,8 @@ function setUpdateState(patch: Partial<DesktopUpdateState>): void {
945
}
946
947
function shouldEnableAutoUpdates(): boolean {
948
+ const hasUpdateFeedConfig =
949
+ readAppUpdateYml() !== null || Boolean(process.env.T3CODE_DESKTOP_MOCK_UPDATES);
950
return (
951
getAutoUpdateDisabledReason({
952
isDevelopment,
@@ -949,6 +954,7 @@ function shouldEnableAutoUpdates(): boolean {
954
platform: process.platform,
955
appImage: process.env.APPIMAGE,
956
disabledByEnv: process.env.T3CODE_DISABLE_AUTO_UPDATE === "1",
957
+ hasUpdateFeedConfig,
958
}) === null
959
);
960
}
@@ -1032,17 +1038,6 @@ async function installDownloadedUpdate(): Promise<{ accepted: boolean; completed
1038
}
1039
1040
function configureAutoUpdater(): void {
1035
- const enabled = shouldEnableAutoUpdates();
1036
- setUpdateState({
1037
- ...createInitialDesktopUpdateState(app.getVersion(), desktopRuntimeInfo),
1038
- enabled,
1039
- status: enabled ? "idle" : "disabled",
1040
- });
1041
- if (!enabled) {
1042
- return;
1043
- }
1044
- updaterConfigured = true;
1045
-
1041
const githubToken =
1042
process.env.T3CODE_DESKTOP_UPDATE_GITHUB_TOKEN?.trim() || process.env.GH_TOKEN?.trim() || "";
1043
if (githubToken) {
@@ -1067,6 +1062,17 @@ function configureAutoUpdater(): void {
1062
});
1063
}
1064
1065
+ const enabled = shouldEnableAutoUpdates();
1066
+ setUpdateState({
1067
+ ...createInitialDesktopUpdateState(app.getVersion(), desktopRuntimeInfo),
1068
+ enabled,
1069
+ status: enabled ? "idle" : "disabled",
1070
+ });
1071
+ if (!enabled) {
1072
+ return;
1073
+ }
1074
+ updaterConfigured = true;
1075
+
1076
autoUpdater.autoDownload = false;
1077
autoUpdater.autoInstallOnAppQuit = false;
1078
// Keep alpha branding, but force all installs onto the stable update track.
apps/desktop/src/updateState.test.ts
+29
@@ -71,10 +71,37 @@ describe("getAutoUpdateDisabledReason", () => {
71
platform: "darwin",
72
appImage: undefined,
73
disabledByEnv: false,
74
+ hasUpdateFeedConfig: true,
75
}),
76
).toContain("packaged production builds");
77
});
78
79
+ it("reports packaged local builds without an update feed as disabled", () => {
80
+ expect(
81
+ getAutoUpdateDisabledReason({
82
+ isDevelopment: false,
83
+ isPackaged: true,
84
+ platform: "darwin",
85
+ appImage: undefined,
86
+ disabledByEnv: false,
87
+ hasUpdateFeedConfig: false,
88
+ }),
89
+ ).toContain("no update feed");
90
+ });
91
+
92
+ it("allows packaged builds with an update feed", () => {
93
+ expect(
94
+ getAutoUpdateDisabledReason({
95
+ isDevelopment: false,
96
+ isPackaged: true,
97
+ platform: "darwin",
98
+ appImage: undefined,
99
+ disabledByEnv: false,
100
+ hasUpdateFeedConfig: true,
101
+ }),
102
+ ).toBeNull();
103
+ });
104
+
105
it("reports env-disabled auto updates", () => {
106
expect(
107
getAutoUpdateDisabledReason({
@@ -83,6 +110,7 @@ describe("getAutoUpdateDisabledReason", () => {
110
platform: "darwin",
111
appImage: undefined,
112
disabledByEnv: true,
113
+ hasUpdateFeedConfig: true,
114
}),
115
).toContain("T3CODE_DISABLE_AUTO_UPDATE");
116
});
@@ -95,6 +123,7 @@ describe("getAutoUpdateDisabledReason", () => {
123
platform: "linux",
124
appImage: undefined,
125
disabledByEnv: false,
126
+ hasUpdateFeedConfig: true,
127
}),
128
).toContain("AppImage");
129
});
apps/desktop/src/updateState.ts
+4
@@ -34,7 +34,11 @@ export function getAutoUpdateDisabledReason(args: {
34
platform: NodeJS.Platform;
35
appImage?: string | undefined;
36
disabledByEnv: boolean;
37
+ hasUpdateFeedConfig: boolean;
38
}): string | null {
39
+ if (!args.hasUpdateFeedConfig) {
40
+ return "Automatic updates are not available because no update feed is configured.";
41
+ }
42
if (args.isDevelopment || !args.isPackaged) {
43
return "Automatic updates are only available in packaged production builds.";
44
}