Skip to content

fix(updater): 安装失败可见化 + 手动下载兜底 + 错误写日志 (#706)#708

Open
appergb wants to merge 1 commit into
betafrom
fix/updater-install-error-visibility
Open

fix(updater): 安装失败可见化 + 手动下载兜底 + 错误写日志 (#706)#708
appergb wants to merge 1 commit into
betafrom
fix/updater-install-error-visibility

Conversation

@appergb

@appergb appergb commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

User description

背景

修复 #706:macOS/桌面自动更新「提示更新 → 下载中 → 下载完弹框消失 → 之后无反应、重启仍旧版」。

根因

AutoUpdate.tsxinstallUpdate() 里,update.download()/install() 一旦抛错,catchstatus 置成 'error'。但 UpdateDialog 只在 available/downloading/installing/downloaded 渲染——error 态下弹框直接消失,错误只 console.error(还不进 openless.log,用户完全无感知。底层 install() 失败最可能是 ad-hoc 签名 + com.apple.quarantine → App Translocation → 原地替换 .app 失败。

改动

  • 新增独立状态 installError:仅「下载/安装失败」用它。'error' 仍表示「检查失败」,行为完全不变——CheckUpdateButton 仍是按钮内 2.5s 轻提示、后台 60min 自动检查失败也不弹框(零回归,避免网络波动时无故弹错误框)。
  • 失败弹框留在原地显示真实错误 + 「手动下载」按钮直达 GitHub Releases 兜底。
  • 新增 Rust IPC log_client_error,把前端更新错误写进 openless.log(webview console 不入文件日志),便于用户「关于 → 导出日志」后定位真因。
  • 5 个 i18n 文件补 updateDialog.installError / manualDownload(zh-CN/zh-TW/ja/en/ko)。

影响面

AutoUpdate.tsx(状态机 + 弹框)、两处渲染点(AutoUpdateGate.tsx 后台、CheckUpdateButton.tsx 设置页)、lib/ipc(新增 logClientError)、lib.rs(新增命令 + desktop/mobile 两处注册)、5 个 i18n。共 11 文件 +78/-9。

验证

  • npx tsc --noEmit 通过
  • cargo check --manifest-path src-tauri/Cargo.toml 通过(仅既有 warning)
  • 真机:本地无 JS test runner,且需真·更新失败才会走到该路径;真机效果待下一个失败用户暴露新弹框/日志确认

重要边界(非本 PR 范围)

这是兜底(失败可见 + 可诊断 + 手动路径),让 ad-hoc/quarantine 机器的自动更新「真正成功」。根治需 Apple Developer ID 签名 + 公证(暂缓,无开发者账号)。后续 Phase 2 计划:自建更新服务器(3-backend axum)控版本/灰度/强更/kill-switch + 前端 OTA 热补丁。

Closes #706


PR Type

Bug fix, Enhancement


Description

  • Show install failure error dialog instead of disappearing

  • Add manual download button to GitHub Releases

  • Log client errors to openless.log via new Rust IPC

  • Add i18n strings for install error and manual download


Diagram Walkthrough

flowchart LR
  A[Download & Install] -->|success| B[Downloaded]
  A -->|failure| C[Install Error]
  C --> D[Show error + Manual Download]
Loading

File Walkthrough

Relevant files
Enhancement
8 files
lib.rs
Add log_client_error Rust IPC command                                       
+22/-0   
en.ts
Add installError and manualDownload i18n keys                       
+5/-0     
ja.ts
Add Japanese translation for install error                             
+5/-0     
ko.ts
Add Korean translation for install error                                 
+5/-0     
zh-CN.ts
Add Chinese translation for install error                               
+5/-0     
zh-TW.ts
Add Traditional Chinese translation                                           
+5/-0     
index.ts
Export logClientError function                                                     
+1/-1     
utils.ts
Implement logClientError with invoke                                         
+13/-0   
Bug fix
3 files
AutoUpdate.tsx
Add installError status and manual download                           
+27/-8   
AutoUpdateGate.tsx
Pass errorMessage to UpdateDialog                                               
+1/-0     
CheckUpdateButton.tsx
Pass errorMessage to UpdateDialog                                               
+1/-0     

@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

(Review updated until commit 068cb17)

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

706 - Partially compliant

Compliant requirements:

  • 安装失败后弹框不再消失,而是显示真实错误信息和手动下载按钮。
  • 手动下载按钮直达 GitHub Releases,提供兜底方案。
  • 前端更新错误被写入 openless.log,方便排查。

Non-compliant requirements:

  • 自动更新过程(点击“确定更新”后)仍可能失败;主根因(如 ad-hoc 签名 + App Translocation)未修复,因此不能保证自动完成更新。

Requires further human verification:

  • 底层安装失败的根本原因(macOS App Translocation、com.apple.quarantine 等)未在本次 PR 中修复,需要后续进一步调研和验证。
⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Missing i18n key

In the UpdateDialog component, the fallback for a null errorMessage uses t('settings.about.updateError'). This key is not added in this PR's i18n changes (only installError and manualDownload were added). If errorMessage is ever falsy (e.g., empty string or null from the error catch), the translation will fall back to this missing key, resulting in a broken UI (showing the key string). Add the missing key to all five locale files or remove the fallback.

? t('settings.about.updateDialog.installError.desc', { error: errorMessage || t('settings.about.updateError') })
: t(`settings.about.updateDialog.${status}.desc`, { version })}

下载完成后若 install() 抛错,旧代码把 status 置成 'error',而 UpdateDialog 不渲染 error 态 → 弹框消失、错误只 console.error,用户表现为「下载后无反应、重启仍旧版」(#706)。

- 新增独立状态 installError:仅下载/安装失败用它;'error' 仍表示「检查失败」,行为不变(CheckUpdateButton 按钮内轻提示、后台自动检查都不弹框,零回归)。
- 失败弹框留在原地显示真实错误 + 「手动下载」按钮直达 GitHub Releases 兜底。
- 新增 Rust IPC log_client_error,把前端更新错误写进 openless.log(webview console 不入文件日志),便于用户「导出日志」后定位真因。
- 5 个 i18n 文件补 updateDialog.installError / manualDownload。

注意:这是兜底(失败可见 + 可诊断),不解决 ad-hoc/quarantine 机器自动更新真正成功的问题——那需要 Apple Developer ID 签名 + 公证(本次暂缓)。
@appergb appergb force-pushed the fix/updater-install-error-visibility branch from fb1889b to 068cb17 Compare June 18, 2026 04:43
@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit 068cb17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[infra] 提示更新:下载后无反应

1 participant