zai-org / zai-org/feedback

[Bug] Linux AppImage 自动更新后桌面入口仍指向已删除的旧版本,导致 ZCode 无法启动

Open
#376 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

priority: P2
Dominant language
No language data
Stars
22
Forks
1
PR merge metrics
No merged PRs in 30d

Description

提交前确认 · Pre-submission checklist
  • 我已搜索现有 Issues/Discussions;未发现相同问题。
  • 我已阅读 CONTRIBUTING.md。
  • 已对用户名、项目路径及无关配置做脱敏。
问题类别 · Category

稳定性 / 自动更新 · Stability / Auto-update

涉及框架 · Agent framework

ZCode Agent(自研)

严重程度 · Severity

阻塞使用:更新完成后,GNOME 应用入口指向不存在的文件,用户无法从原入口启动 ZCode,看起来像应用被卸载。

复现频率 · Reproducibility

在一次 3.7.7 -> 3.9.1 自动升级中观察到;升级后的文件系统状态和日志均已核实。

问题描述 · Description

在 Linux 用户级 AppImage 安装中,ZCode 自动更新成功下载并安装了新版本,旧的版本化 AppImage 被移除,但 ~/.local/share/applications/zcode.desktopExec 仍硬编码指向旧版本文件。由于更新退出时没有启动新版本,新版本也没有机会重新注册桌面入口,导致下次从 GNOME 启动失败。

这不是更新包下载失败:新版本 AppImage 完整存在且可以手动启动。问题发生在更新后的启动入口衔接。

使用环境 · Environment
  • OS: Fedora Linux 44, x86_64
  • Kernel: 7.1.10-200.fc44.x86_64
  • Desktop: GNOME / Wayland
  • Install type: user-level Linux x64 AppImage
  • Install directory: ~/.local/opt/ZCode/
  • Source version: ZCode 3.7.7
  • Target version: ZCode 3.9.1
  • autoDownloadAndInstallUpdates: true
复现步骤 · Steps to reproduce
  1. 将版本化 AppImage 安装为 ~/.local/opt/ZCode/ZCode-3.7.7-linux-x64.AppImage
  2. 通过 ZCode 注册的 GNOME 桌面入口启动;该入口的 Exec 指向上述具体版本文件。
  3. 保持自动下载与安装更新开启。
  4. ZCode 检测并下载 3.9.1
  5. 正常关闭 ZCode,让更新程序在退出时自动安装。
  6. 再次从 GNOME 应用菜单启动 ZCode。
期望表现 · Expected behavior

更新过程应在删除旧 AppImage 前,原子地完成以下任一方案:

  • 将桌面入口更新为新 AppImage 路径;或
  • 始终让桌面入口指向不含版本号的稳定启动路径;或
  • 更新后启动一次新版本,让它完成入口迁移;若迁移失败则保留/回滚旧入口。
实际表现 · Actual behavior

更新后:

~/.local/opt/ZCode/ZCode-3.9.1-linux-x64.AppImage   # 存在,可正常运行
~/.local/opt/ZCode/ZCode-3.7.7-linux-x64.AppImage   # 已不存在

~/.local/share/applications/zcode.desktop:
Exec="/home/<user>/.local/opt/ZCode/ZCode-3.7.7-linux-x64.AppImage" %U

桌面入口因此成为断链;用户必须手动找到新 AppImage 并修复 .desktop 文件。

脱敏日志 · Sanitized logs
[2026-08-25 08:48:45] Linux 用户级协议注册成功
  executablePath=/home/<user>/.local/opt/ZCode/ZCode-3.7.7-linux-x64.AppImage
[2026-08-25 08:48:45] electron initialized env=prod version=3.7.7
[2026-08-25 08:48:46] Found version 3.9.1
[2026-08-25 08:48:56] New version 3.9.1 has been downloaded
[2026-08-25 08:48:56] downloaded: 3.9.1, ready to install on quit or explicit install
[2026-08-25 12:30:00] Auto install update on quit
[2026-08-25 12:30:00] Install: isSilent: true, isForceRunAfter: false

同一退出时间还记录到两个 core dump:

zcode --type=zygote: SIGBUS
chrome_crashpad: core dumped

它们可能是更新时卸载旧 AppImage 的结果,也可能与入口未更新是并行现象,暂不能确认因果关系。

临时恢复方法 · Workaround

手动下载新版 AppImage,并把 zcode.desktopExec 改到新文件后可恢复启动。升级到 3.9.2 后已验证应用本体、图标和 zcode:// 协议均正常。

相关 Issue · Related

与 #271 同属 Linux 更新链路,但现象不同:#271 是 root-owned 系统级安装无法替换旧版本;本 Issue 是用户可写目录中的新版本已安装、旧版本已移除,但版本化桌面入口没有同步更新。

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect the Linux user-level AppImage update-on-quit flow and the generated ~/.local/share/applications/zcode.desktop entry, starting from the logged isSilent: true, isForceRunAfter: false install path. Reproduce the 3.7.7→3.9.1 upgrade and verify that after the old AppImage is removed, the desktop entry resolves to the installed version and launching from GNOME still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron, linux
Domain
desktop, release
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.