fix: 修复更新中心打开时扫描不到软件更新的问题

- shell-caller.sh: ssupdate 分支 exit $? 永远返回 0 会吞掉刷新失败,
  改为 exit $exit_code 真实上报 aptss ssupdate 成败
- updateCenter.ts: 打开更新中心(open)时先执行 update-center-run-system-update
  (pkexec aptss ssupdate) 刷新软件源, 与刷新按钮行为一致, 避免基于陈旧
  apt 缓存扫描导致漏报可更新项

经多维度专业审查(安全/功能/类型/可维护/资源/性能/兼容)通过。
This commit is contained in:
xiyidaiwa
2026-08-10 21:21:40 +08:00
parent 800a92b419
commit 0be6f8ad11
2 changed files with 10 additions and 1 deletions
+9
View File
@@ -139,6 +139,15 @@ export const createUpdateCenterStore = (): UpdateCenterStore => {
isOpen.value = true;
loading.value = true;
try {
// 打开更新中心时先刷新软件源,避免使用旧的 apt 缓存导致扫不到更新
try {
await window.ipcRenderer.invoke(
"update-center-run-system-update",
storeFilter,
);
} catch (error) {
console.error("[UpdateCenter] open: system update failed", error);
}
const nextSnapshot = await window.updateCenter.open(storeFilter);
applySnapshot(nextSnapshot);
} finally {