cicy-desktop 2.1.231 → 2.1.232

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/app-updater.js +14 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cicy-desktop",
3
- "version": "2.1.231",
3
+ "version": "2.1.232",
4
4
  "description": "CiCy - AI-powered operating system browser",
5
5
  "main": "src/main.js",
6
6
  "bin": {
@@ -87,17 +87,20 @@ function headOk(url, redirects = 0) {
87
87
 
88
88
  // ── 最新版本号 ────────────────────────────────────────────────────────────────
89
89
  async function fetchLatestVersion(network) {
90
- if (network === "cn") {
91
- // CN:OSS 版本清单(纯文本 "2.1.200")。**按平台读各自的指针** —— win 和 mac 是两条独立
92
- // CI、分别构建上传、版本可能不同步;都读裸名 latest-version.txt(只由 Windows CI 写)会让
93
- // mac 客户端拿到 Windows 的版本号 → 去下不存在的 mac 包 → 404。win→win-、mac→mac-,
94
- // linux 没有独立 OSS 指针、沿用裸名(win 同 tag 同步发布,且 linux 实际走 GitHub 下载)
95
- const file = process.platform === "win32" ? "win-latest-version.txt"
96
- : process.platform === "darwin" ? "mac-latest-version.txt"
97
- : "latest-version.txt";
90
+ // **Windows 包只在 OSS(GitHub 不发 win),版本清单也一律读 OSS —— 与网络判定无关。**
91
+ // 否则 net=unknown(启动探测超时会被缓存成 unknown 整个会话) global 时去读 GitHub,CN
92
+ // 用户读不到 → 更新提示整段会话都不出现(用户报的「更新 banner 没出现」)。win→win-latest。
93
+ if (process.platform === "win32") {
94
+ return (await getText(`${OSS_RELEASES_BASE}/win-latest-version.txt`)).trim().replace(/^v/, "");
95
+ }
96
+ // mac/linux:net-detect 契约是「cn unknown 都优先镜像」—— 只有确认可达 GitHub(global)
97
+ // 才走 GitHub;cn/unknown 一律读 OSS。按平台读各自指针(win/mac 两条独立 CI、版本可能不
98
+ // 同步,读错平台会 404);linux 无独立 OSS 指针、沿用裸名(与 win 同 tag、走 GitHub 下载)。
99
+ if (network !== "global") {
100
+ const file = process.platform === "darwin" ? "mac-latest-version.txt" : "latest-version.txt";
98
101
  return (await getText(`${OSS_RELEASES_BASE}/${file}`)).trim().replace(/^v/, "");
99
102
  }
100
- // CN:GitHub releases/latest 的 tag_name。
103
+ // 确认可达 GitHub:releases/latest 的 tag_name。
101
104
  const j = JSON.parse(await getText(`https://api.github.com/repos/${REPO}/releases/latest`));
102
105
  return String(j.tag_name || "").trim().replace(/^v/, "");
103
106
  }
@@ -112,11 +115,11 @@ function assetFor(version, network) {
112
115
  }
113
116
  if (plat === "darwin") {
114
117
  const gh = `${GH_DL(version)}/cicy-desktop-${version}-${arch}.pkg`;
115
- return { url: network === "cn" ? mirrored(gh) : gh, file: `cicy-desktop-${version}-${arch}.pkg` };
118
+ return { url: network === "global" ? gh : mirrored(gh), file: `cicy-desktop-${version}-${arch}.pkg` };
116
119
  }
117
120
  // linux
118
121
  const gh = `${GH_DL(version)}/CiCy-Desktop-${version}.AppImage`;
119
- return { url: network === "cn" ? mirrored(gh) : gh, file: `CiCy-Desktop-${version}.AppImage` };
122
+ return { url: network === "global" ? gh : mirrored(gh), file: `CiCy-Desktop-${version}.AppImage` };
120
123
  }
121
124
 
122
125
  // ── 下载(带进度,跟随重定向)──────────────────────────────────────────────────