Skip to content

fix(update): 解压目录清理失败时终止安装 - #438

Open
MistEO wants to merge 1 commit into
mainfrom
codex/update-staging-cleanup
Open

MistEO wants to merge 1 commit into
mainfrom
codex/update-staging-cleanup

Conversation

@MistEO

@MistEO MistEO commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

上一次解压残留的 changes.json 被占用时,清理失败会被忽略。下一份全量包继续解压后,客户端可能按旧清单执行增量更新。

本次在预清理失败时返回现有的本地化 extractFailed 错误,保留下载包和待安装记录。释放占用后可以手动重试,解压、配置备份和安装都在预清理成功之后执行。

通过了独立代码 review。新增测试直接加载生产更新服务,覆盖 IPC 字符串错误、待安装记录保留、后续命令未调用和成功重试。pnpm test 121 项通过、1 项跳过,pnpm build 通过。测试使用 Tauri 边界 mocks,未触发真实应用更新或重启。

基于 main c321532。#394 的安装后清理处理针对另一阶段,#416 的启动安装调整也保留了这个预清理入口。

Sourcery 总结

要求暂存目录清理成功后才能继续,避免旧的已提取更新文件混入新安装。

错误修复:

  • 如果清理上一次提取目录失败,则中止更新安装,返回本地化的提取错误,并保留待处理的更新以便重试。

测试:

  • 添加集成式测试,覆盖清理失败处理、待处理更新的保留、后续操作中止以及手动重试成功等情况。
Original summary in English

Summary by Sourcery

Prevent stale extracted update files from being mixed into a new installation by requiring staging cleanup to succeed before proceeding.

Bug Fixes:

  • Abort update installation when cleanup of the previous extraction directory fails, returning a localized extraction error and preserving the pending update for retry.

Tests:

  • Add integration-style coverage for cleanup failure handling, pending update preservation, aborted follow-up operations, and successful manual retry.

AI 使用信息:

  • 实现、内部审查:Agent 为 Codex;模型为 gpt-6-astra;思考强度为 ultra。内部子代理继承父任务配置。
  • 审计交叉审查:Agent 为 Codex;模型为 gpt-6.1-sol;思考强度为 max(协调调用选定)。

@MistEO
MistEO marked this pull request as ready for review November 11, 2026 02:27
Copilot AI balanced review requested due to automatic review settings November 11, 2026 02:27
@sourcery-ai

sourcery-ai Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Sorry @MistEO, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 7 hours and 49 minutes by commenting @sourcery-ai review. Upgrade to get a review now.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T02:28:57.199574Z 085c8c9 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants