Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 21 additions & 10 deletions apps/web/src/components/sidebar/updateEverything.logic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,20 @@ function machine(
};
}

// A desktop-mode server the desktop app cannot control, such as a WSL backend or an older app.
function withoutDesktopControl(base: UpdateEverythingMachine): UpdateEverythingMachine {
return {
...base,
serverConfig: {
...base.serverConfig!,
environment: {
...base.serverConfig!.environment,
capabilities: { repositoryIdentity: true, serverSelfUpdate: "desktop-managed" },
},
},
};
}

describe("collectServerUpdateTargets", () => {
it("updates remote servers that can move to the target and names every skipped one", () => {
const { targets, skipped } = collectServerUpdateTargets(
Expand All @@ -67,6 +81,7 @@ describe("collectServerUpdateTargets", () => {
machine("current", "0.0.50", "boot-service"),
machine("current-offline", "0.0.50", "boot-service", { connected: false }),
machine("manual", "0.0.40", undefined),
withoutDesktopControl(machine("wsl-backend", "0.0.40", "desktop-managed")),
],
"0.0.50",
);
Expand All @@ -82,6 +97,7 @@ describe("collectServerUpdateTargets", () => {
["no-scope", "no permission"],
["busy", "already updating"],
["manual", "needs a manual update"],
["wsl-backend", "update T3 Code on that machine"],
]);
});

Expand Down Expand Up @@ -230,15 +246,9 @@ describe("collectChannelSwitchTargets", () => {
host(machine("service", "0.1.2", "boot-service"), 70),
// A Stable tag built a migration the latest Nightly does not have yet.
host(machine("ahead", "0.1.3", "boot-service"), 73),
machine("old-desktop", "0.1.2", "desktop-managed", {
serverConfig: {
...machine("old-desktop", "0.1.2", "desktop-managed").serverConfig!,
environment: {
...machine("old-desktop", "0.1.2", "desktop-managed").serverConfig!.environment,
capabilities: { repositoryIdentity: true, serverSelfUpdate: "desktop-managed" },
},
},
}),
withoutDesktopControl(machine("old-desktop", "0.1.2", "desktop-managed")),
// Already on Nightly, so it needs an update rather than a channel switch.
withoutDesktopControl(machine("behind-desktop", OLD_NIGHTLY, "desktop-managed")),
machine("current", NIGHTLY, "boot-service"),
// The server refuses a track its policy rules out, so the dialog skips it up front.
managedHost(host(machine("no-nightly", "0.1.2", "boot-service"), 70)),
Expand All @@ -254,7 +264,8 @@ describe("collectChannelSwitchTargets", () => {
"ahead",
`its database has changes ${NIGHTLY} does not support yet; stay on Stable until Nightly has them`,
],
["old-desktop", "needs a newer desktop app"],
["old-desktop", "change the update track on that machine"],
["behind-desktop", "update T3 Code on that machine"],
[
"no-nightly",
"Example Corp manages T3 Code updates. Only stable releases can be installed.",
Expand Down
12 changes: 10 additions & 2 deletions apps/web/src/components/sidebar/updateEverything.logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ export interface SkippedMachine {
readonly reason: string;
}

// Desktop servers without the desktop control fd (older apps, WSL backends: wsl.exe cannot pass
// fds) cannot be updated from here, and their desktop app is not necessarily the stale part.
const UPDATE_ON_THAT_MACHINE = msg("update T3 Code on that machine");

/** Skip current and app-hosted servers; the latter update with the app and would relaunch mid-run.
* Desktop-managed servers use their own feed. Each server's updater checks that it can install the
* release before it restarts, so no registry precheck runs here. */
Expand Down Expand Up @@ -115,7 +119,7 @@ export function collectServerUpdateTargets(
continue;
}
if (selfUpdate === "desktop-managed" && !desktopAppUpdate) {
skip(resolve(msg("needs a newer desktop app")));
skip(resolve(UPDATE_ON_THAT_MACHINE));
continue;
}
const serverChannel = cliReleaseChannelOf(config.environment.serverVersion);
Expand Down Expand Up @@ -425,7 +429,11 @@ function trackSwitchMove(
if (selfUpdate === null) return { skip: resolve(msg("needs a manual update")) };
if (selfUpdate !== "desktop-managed") return { selfUpdate };
if (config.environment.capabilities.desktopAppChannelSwitch !== true) {
return { skip: resolve(msg("needs a newer desktop app")) };
return {
skip: resolve(
sameTrack ? UPDATE_ON_THAT_MACHINE : msg("change the update track on that machine"),
),
};
}
// Squirrel.Mac renames the bundle for the new track and then cannot relaunch it.
if (!sameTrack && config.environment.platform.os === "darwin") {
Expand Down
3 changes: 2 additions & 1 deletion apps/web/src/i18n/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -12145,7 +12145,8 @@
"f938bb483eb3d189": "startet zuletzt neu",
"9bca02be2b4d612a": "nicht verbunden",
"2dcc418b6a13b83c": "erfordert manuelles Update",
"5c8ebc36f84dee7a": "erfordert eine neuere Desktop-App",
"f13e08bd3614112e": "T3 Code auf diesem Rechner aktualisieren",
"3c3348c36a2695af": "Update-Kanal auf diesem Rechner ändern",
"fa8faa732a2688ef": "im Kanal {channel}",
"9b961309baafa09d": "keine Berechtigung",
"9bafb2622c22d145": "wird bereits aktualisiert",
Expand Down
3 changes: 2 additions & 1 deletion apps/web/src/i18n/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -12153,7 +12153,8 @@
"f938bb483eb3d189": "restarts last",
"9bca02be2b4d612a": "not connected",
"2dcc418b6a13b83c": "needs a manual update",
"5c8ebc36f84dee7a": "needs a newer desktop app",
"f13e08bd3614112e": "update T3 Code on that machine",
"3c3348c36a2695af": "change the update track on that machine",
"fa8faa732a2688ef": "on the {channel} channel",
"9b961309baafa09d": "no permission",
"9bafb2622c22d145": "already updating",
Expand Down
3 changes: 2 additions & 1 deletion apps/web/src/i18n/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -12138,7 +12138,8 @@
"f938bb483eb3d189": "se reinicia el último",
"9bca02be2b4d612a": "sin conexión",
"2dcc418b6a13b83c": "requiere una actualización manual",
"5c8ebc36f84dee7a": "requiere una app de escritorio más reciente",
"f13e08bd3614112e": "actualiza T3 Code en ese equipo",
"3c3348c36a2695af": "cambia el canal de actualizaciones en ese equipo",
"fa8faa732a2688ef": "en el canal {channel}",
"9b961309baafa09d": "sin permiso",
"9bafb2622c22d145": "ya se está actualizando",
Expand Down
3 changes: 2 additions & 1 deletion apps/web/src/i18n/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -12143,7 +12143,8 @@
"f938bb483eb3d189": "redémarre en dernier",
"9bca02be2b4d612a": "non connecté",
"2dcc418b6a13b83c": "nécessite une mise à jour manuelle",
"5c8ebc36f84dee7a": "nécessite une version plus récente de l’app de bureau",
"f13e08bd3614112e": "mettez à jour T3 Code sur cette machine",
"3c3348c36a2695af": "changez le canal de mise à jour sur cette machine",
"fa8faa732a2688ef": "sur le canal {channel}",
"9b961309baafa09d": "pas d’autorisation",
"9bafb2622c22d145": "déjà en cours de mise à jour",
Expand Down
3 changes: 2 additions & 1 deletion apps/web/src/i18n/translations/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -12094,7 +12094,8 @@
"f938bb483eb3d189": "最後に再起動",
"9bca02be2b4d612a": "未接続",
"2dcc418b6a13b83c": "手動での更新が必要",
"5c8ebc36f84dee7a": "新しいデスクトップアプリが必要",
"f13e08bd3614112e": "そのマシンで T3 Code を更新してください",
"3c3348c36a2695af": "そのマシンで更新トラックを変更してください",
"fa8faa732a2688ef": "{channel} チャネル",
"9b961309baafa09d": "権限なし",
"9bafb2622c22d145": "すでに更新中",
Expand Down
3 changes: 2 additions & 1 deletion apps/web/src/i18n/translations/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -12090,7 +12090,8 @@
"f938bb483eb3d189": "마지막에 다시 시작",
"9bca02be2b4d612a": "연결되지 않음",
"2dcc418b6a13b83c": "수동 업데이트 필요",
"5c8ebc36f84dee7a": "최신 데스크톱 앱 필요",
"f13e08bd3614112e": "해당 기기에서 T3 Code를 업데이트하세요",
"3c3348c36a2695af": "해당 기기에서 업데이트 트랙을 변경하세요",
"fa8faa732a2688ef": "{channel} 채널",
"9b961309baafa09d": "권한 없음",
"9bafb2622c22d145": "이미 업데이트 중",
Expand Down
3 changes: 2 additions & 1 deletion apps/web/src/i18n/translations/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -12143,7 +12143,8 @@
"f938bb483eb3d189": "reinicia por último",
"9bca02be2b4d612a": "não conectado",
"2dcc418b6a13b83c": "precisa de atualização manual",
"5c8ebc36f84dee7a": "precisa de um app desktop mais novo",
"f13e08bd3614112e": "atualize o T3 Code nessa máquina",
"3c3348c36a2695af": "mude o canal de atualização nessa máquina",
"fa8faa732a2688ef": "no canal {channel}",
"9b961309baafa09d": "sem permissão",
"9bafb2622c22d145": "já está atualizando",
Expand Down
3 changes: 2 additions & 1 deletion apps/web/src/i18n/translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -12144,7 +12144,8 @@
"f938bb483eb3d189": "перезапуск последним",
"9bca02be2b4d612a": "не подключено",
"2dcc418b6a13b83c": "нужно обновить вручную",
"5c8ebc36f84dee7a": "нужна более новая версия десктопного приложения",
"f13e08bd3614112e": "обновите T3 Code на этом компьютере",
"3c3348c36a2695af": "смените канал обновлений на этом компьютере",
"fa8faa732a2688ef": "на канале {channel}",
"9b961309baafa09d": "нет прав",
"9bafb2622c22d145": "уже обновляется",
Expand Down
3 changes: 2 additions & 1 deletion apps/web/src/i18n/translations/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -12151,7 +12151,8 @@
"f938bb483eb3d189": "startar om sist",
"9bca02be2b4d612a": "inte ansluten",
"2dcc418b6a13b83c": "behöver uppdateras manuellt",
"5c8ebc36f84dee7a": "behöver en nyare skrivbordsapp",
"f13e08bd3614112e": "uppdatera T3 Code på den datorn",
"3c3348c36a2695af": "byt uppdateringsspår på den datorn",
"fa8faa732a2688ef": "på kanalen {channel}",
"9b961309baafa09d": "ingen behörighet",
"9bafb2622c22d145": "uppdateras redan",
Expand Down
3 changes: 2 additions & 1 deletion apps/web/src/i18n/translations/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -12169,7 +12169,8 @@
"f938bb483eb3d189": "最后重启",
"9bca02be2b4d612a": "未连接",
"2dcc418b6a13b83c": "需要手动更新",
"5c8ebc36f84dee7a": "需要更高版本的桌面应用",
"f13e08bd3614112e": "请在该机器上更新 T3 Code",
"3c3348c36a2695af": "请在该机器上更改更新通道",
"fa8faa732a2688ef": "使用 {channel} 通道",
"9b961309baafa09d": "没有权限",
"9bafb2622c22d145": "正在更新",
Expand Down
Loading