Skip to content
Open
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

### 修复
- 修复 PostgreSQL 控制面凭证在配置保存重载时被重复编码的问题,并保留用户名和密码中的空格。
- Linux 桌面端能识别更新清单中的 `linux_x64` / `linux_arm` 资产,不再固定显示「已是最新」

## [1.0.3b7] - 2026-11-17

Expand Down
2 changes: 2 additions & 0 deletions dashboard/src/api/modules/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export interface UpdateStatus {
last_check_time: string | null;
/** Markdown changelog for latest_version, null if not available. */
release_notes: string | null;
/** Channel head is newer but has no installable asset for this platform. */
platform_asset_missing?: boolean;
/** When true (default), automatic checks ignore pre-releases. */
stable_only?: boolean;
/** True when latest_version is a PEP 440 pre-release. */
Expand Down
1 change: 1 addition & 0 deletions dashboard/src/hooks/useUpdateStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ function statusFromShell(res: DesktopUpdateCheckResult): UpdateStatus {
source: null,
last_check_time: new Date().toISOString(),
release_notes: null,
platform_asset_missing: res.noAssetForPlatform ?? false,
};
}

Expand Down
1 change: 1 addition & 0 deletions dashboard/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -4299,6 +4299,7 @@
"restartFailed": "Restart request failed. Check the service and try again.",
"releaseNotes": "Release Notes",
"shellManaged": "The desktop client is updated by its shell, which detects, downloads and installs the shell, frontend and bundled Python runtime as one release.",
"noPlatformAsset": "The selected channel has a newer release, but no package for this platform yet. On Linux, turn off \"Stable only\" to get beta builds.",
"updateModalTitle": "New Version Available",
"guideTitle": "Update by install method",
"guideIntro": "If the one-click upgrade on the left is unavailable, pick the commands for your install method. Restart after upgrading; data stays in ~/.octop (or OCTOP_HOME).",
Expand Down
1 change: 1 addition & 0 deletions dashboard/src/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -4299,6 +4299,7 @@
"restartFailed": "重启请求失败,请检查服务状态后重试",
"releaseNotes": "更新说明",
"shellManaged": "桌面客户端的更新由壳统一检测、下载并安装:壳、前端界面与内置 Python 运行时随同一版本一起发布。",
"noPlatformAsset": "当前通道有新版本,但暂时没有适合此平台的安装包。Linux 用户可关闭「只更新稳定版」以获取测试版构建。",
"updateModalTitle": "发现新版本",
"guideTitle": "按安装方式更新",
"guideIntro": "若不能使用左侧一键升级,请按你的安装方式选择下方命令。升级后请重启服务;配置与数据默认保留在 ~/.octop(或 OCTOP_HOME)。",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export default function DesktopUpdatePanel() {
: "up-to-date",
currentVersion: status.current_version,
latestVersion: status.latest_version,
noAssetForPlatform: status.platform_asset_missing ?? false,
error: status.error,
}
: null;
Expand Down Expand Up @@ -162,6 +163,12 @@ export default function DesktopUpdatePanel() {
</div>
)}

{result?.noAssetForPlatform && (
<div className={`${styles.alert} ${styles.alertInfo}`}>
<span>{t("advancedSettings.update.noPlatformAsset")}</span>
</div>
)}

<div className={styles.actions}>
<button
type="button"
Expand Down
1 change: 1 addition & 0 deletions dashboard/src/utils/desktopBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface DesktopUpdateCheckResult {
status: "update-available" | "up-to-date" | "error";
currentVersion: string;
latestVersion: string | null;
noAssetForPlatform?: boolean;
error: string | null;
}

Expand Down
15 changes: 14 additions & 1 deletion desktop/src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import { contentTypeFor, isExternalLink, resolveDashboardFile, resolveStaticPath
import { isApiPath, sanitizeForwardHeaders, toBackendUrl } from "./protocol/stream-proxy";
import { WsRelay } from "./protocol/ws-relay";
import {
channelHeadNeedsPlatformAsset,
channelHeadTag,
manifestFromDownloadsResponse,
platformAssetKey,
Expand Down Expand Up @@ -459,12 +460,24 @@ function registerIpcHandlers(): void {
const listed = channelHeadTag(manifest, stableOnly);
const selected = selectRelease(manifest, appVersion, platform, stableOnly);
if (!selected) {
return { status: "up-to-date", currentVersion: appVersion, latestVersion: listed, error: null };
return {
status: "up-to-date",
currentVersion: appVersion,
latestVersion: listed,
noAssetForPlatform: channelHeadNeedsPlatformAsset(
manifest,
appVersion,
platform,
stableOnly,
),
error: null,
};
}
return {
status: "update-available",
currentVersion: appVersion,
latestVersion: selected.tag,
noAssetForPlatform: false,
error: null,
};
} catch (err) {
Expand Down
44 changes: 43 additions & 1 deletion desktop/src/main/update/update-coordinator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import assert from "node:assert/strict";
import { test } from "node:test";

import {
channelHeadNeedsPlatformAsset,
channelHeadTag,
manifestFromDownloadsResponse,
selectRelease,
Expand Down Expand Up @@ -29,7 +30,48 @@ test("platformAssetKey maps platform+arch", () => {
assert.equal(platformAssetKey("darwin", "x64"), "mac_intel");
assert.equal(platformAssetKey("win32", "arm64"), "win_arm");
assert.equal(platformAssetKey("win32", "x64"), "win_x64");
assert.equal(platformAssetKey("linux", "x64"), null);
assert.equal(platformAssetKey("linux", "x64"), "linux_x64");
assert.equal(platformAssetKey("linux", "arm64"), "linux_arm");
assert.equal(platformAssetKey("freebsd", "x64"), null);
});

test("selectRelease picks a Linux asset", () => {
const linuxStable = {
tag: "v1.0.3",
releasesUrl: "https://github.com/x/releases",
assets: {
linux_x64: {
name: "Octop-desktop-linux-amd64-1.0.3.deb",
ext: "deb",
url: "https://download.octop.cloud/Octop-desktop-linux-amd64-1.0.3.deb",
},
},
};

const selection = selectRelease({ client: { stable: linuxStable } }, "1.0.2", "linux_x64", true);

assert.equal(selection?.tag, "v1.0.3");
assert.equal(selection?.asset.ext, "deb");
});

test("channel head without a platform asset is reported separately", () => {
const manifest = { client: { stable } }; // stable carries mac_arm only
assert.equal(
channelHeadNeedsPlatformAsset(manifest, "1.0.1", "linux_x64", true),
true,
);
assert.equal(
channelHeadNeedsPlatformAsset(manifest, "1.0.1", "mac_arm", true),
false,
);
assert.equal(
channelHeadNeedsPlatformAsset(manifest, "1.0.2", "linux_x64", true),
false,
);
assert.equal(
channelHeadNeedsPlatformAsset({ client: { stable, beta } }, "1.0.1", "mac_arm", false),
false,
);
});

test("channel head stays on stable when stableOnly and beta is higher", () => {
Expand Down
33 changes: 30 additions & 3 deletions desktop/src/main/update/update-coordinator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ export interface DownloadAsset {
export interface ChannelRelease {
tag: string;
releasesUrl: string;
assets: Partial<Record<"mac_arm" | "mac_intel" | "win_x64" | "win_arm", DownloadAsset>>;
assets: Partial<
Record<"mac_arm" | "mac_intel" | "win_x64" | "win_arm" | "linux_x64" | "linux_arm", DownloadAsset>
>;
}

export interface DownloadManifest {
Expand Down Expand Up @@ -44,12 +46,13 @@ export function manifestFromDownloadsResponse(body: unknown): DownloadManifest {
return { client: data.client as DownloadManifest["client"] };
}

export type PlatformKey = "mac_arm" | "mac_intel" | "win_x64" | "win_arm";
export type PlatformKey = "mac_arm" | "mac_intel" | "win_x64" | "win_arm" | "linux_x64" | "linux_arm";

export function platformAssetKey(platform: NodeJS.Platform, arch: string): PlatformKey | null {
if (platform === "darwin") return arch === "arm64" ? "mac_arm" : "mac_intel";
if (platform === "win32") return arch === "arm64" ? "win_arm" : "win_x64";
return null; // Linux is not in the current manifest keys (§6.1).
if (platform === "linux") return arch === "arm64" ? "linux_arm" : "linux_x64";
return null;
}

export interface SelectedRelease {
Expand Down Expand Up @@ -138,3 +141,27 @@ export function selectRelease(
const asset = best.assets[platform]!;
return { tag: best.tag, asset, releasesUrl: best.releasesUrl };
}

/**
* True when the channel head is newer than ``currentVersion`` but has no usable
* asset for this platform. The shell must not report "already up to date" in
* that case: on Linux the stable channel can lag behind the beta builds (#3087).
*/
export function channelHeadNeedsPlatformAsset(
manifest: DownloadManifest,
currentVersion: string,
platform: PlatformKey | null,
stableOnly: boolean,
): boolean {
const client = manifest.client;
if (!client) return false;
const candidates: ChannelRelease[] = [];
if (client.stable) candidates.push(client.stable);
if (!stableOnly && client.beta) candidates.push(client.beta);
const heads = candidates.filter((release) => parseVersion(release.tag));
heads.sort((a, b) => compareVersions(b.tag, a.tag));
const head = heads[0];
if (!head || !isNewer(head.tag, currentVersion)) return false;
const asset = platform ? head.assets[platform] : undefined;
return !asset || !isValidAssetUrl(asset.url);
}
2 changes: 2 additions & 0 deletions desktop/src/shared/ipc-contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export interface UpdateCheckResult {
status: "update-available" | "up-to-date" | "error";
currentVersion: string;
latestVersion: string | null;
/** Channel head is newer but has no installable asset for this platform. */
noAssetForPlatform?: boolean;
error: string | null;
}

Expand Down
Loading