Skip to content

fix(desktop): recover outdated managed host storage at startup - #4918

Merged
M4n5ter merged 1 commit into
mainfrom
fix/managed-host-schema-upgrade
Sep 6, 2026
Merged

M4n5ter merged 1 commit into
mainfrom
fix/managed-host-schema-upgrade

Conversation

@M4n5ter

@M4n5ter M4n5ter commented Sep 6, 2026

Copy link
Copy Markdown
Member
English

Summary

  • Fix Desktop startup after upgrading while a managed Local Runtime Host still uses an older storage schema at the same protocol epoch. Previously, Work Board initialization failed outside startup recovery.
  • Check shared local storage before admitting the candidate; close a rejected connection and use the existing managed update/restart flow. Desktop never performs the migration.
  • Preserve manual-update and active-task interruption consent. Unsupported newer schemas and unrelated storage failures do not authorize automatic repair. Remote peers and the protocol epoch are unchanged.

Verification

  • Regression test uses a real SQLite usage-v6 table: Desktop leaves it unchanged, releases the old connection before repair, and becomes ready after the simulated updated owning Host migrates it. Retained usage identity survives.
  • Desktop full suite: 2,317 passed, including the startup recovery regression and real UDS integration. Storage full suite: 1,125 passed, 10 skipped.
  • Full build, typecheck, lint, formatting, renderer architecture, ASF headers and Desktop/UI dependency checks passed.
  • The reported macOS managed service still needs an on-device retry with this branch; no live Mac data was changed during testing.

AI use

  • Generative tooling made a substantive contribution

Tool(s) and scope: Codex — implementation and tests.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
简体中文

Summary

  • 修复升级 Desktop 后,旧 managed Local Runtime Host 协议 epoch 相同、存储 schema 却落后而导致无法启动的问题。此前 Work Board 的初始化错误落在启动恢复流程之外。
  • 在接纳本地连接之前检查共享存储,失败时关闭该连接,进入已有的 managed 更新/重启流程。迁移始终由 Host 执行。
  • 保留手动更新和中断活跃任务的确认;不把更高版本数据库或其它存储故障当作自动修复许可。不修改远程连接或协议 epoch。

Verification

  • 使用真实 SQLite usage-v6 表做回归:Desktop 不修改旧表,先释放连接,再由模拟的新 owning Host 迁移并恢复启动;保留原有 usage 身份记录。
  • Desktop 全量 2,317 项通过,含启动恢复回归及真实 UDS 集成。Storage 全量:1,125 项通过、10 项跳过。
  • 全量构建、类型、lint、格式、renderer 架构、ASF 头及 Desktop/UI 依赖检查通过。
  • 尚需在报告问题的 Mac 上拉取此分支验证 managed 服务升级;测试未修改 Mac 实际数据。

AI use

  • Generative tooling made a substantive contribution

Tool(s) and scope: Codex — 实现与测试。

Checklist

  • 测试覆盖变更,并能捕获修复前的问题
  • 本地 lint、格式、类型及受影响测试通过
  • 行为变化已在 Summary 说明

Validate local storage before admitting the Host candidate and route required migrations through managed startup recovery without granting Desktop migration authority.

Generated-by: Codex
@github-actions github-actions Bot added the effort/M Under 500 readable lines label Sep 6, 2026

@jackwener jackwener left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved at exact head 5d36789f764c886b84818ab672d9afd418f85d7f at the explicit direction of M4n5ter. No technical review was performed as part of this action; M4n5ter requested the approval and accepts responsibility for subsequent handling.


Review notice: This approval was submitted by an automated review agent operated by jackwener and is published at the direction of M4n5ter, who requested this action and is the human accountable for it.

@M4n5ter
M4n5ter merged commit df030ab into main Sep 6, 2026
2 checks passed
@M4n5ter
M4n5ter deleted the fix/managed-host-schema-upgrade branch September 6, 2026 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/M Under 500 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants