Skip to content

fix(desktop): stop renderer before quit cleanup - #3837

Merged
Astro-Han merged 1 commit into
mainfrom
fix/quiet-desktop-quit
Aug 26, 2026
Merged

fix(desktop): stop renderer before quit cleanup#3837
Astro-Han merged 1 commit into
mainfrom
fix/quiet-desktop-quit

Conversation

@M4n5ter

@M4n5ter M4n5ter commented Aug 26, 2026

Copy link
Copy Markdown
Member
English

Summary

Destroy the main Renderer before retiring the owned local Runtime Host. This prevents Renderer IPC from racing handler teardown during a normal Desktop quit and removes misleading No handler registered errors from the shutdown log.

Verification

  • Launched npm run dev with an isolated profile and quit through the macOS application quit event; shutdown logged only the clean local Host exit
  • npx tsc -p apps/desktop/tsconfig.main.json --noEmit
  • App quit coordinator tests: 6 passed
  • npm run lint
  • npm run format:check
  • Full repository typecheck remains blocked on the current origin/main error in runtime-host-session-catalog.ts (DesktopSessionSummary.id)

AI use

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Codex investigated the shutdown race, implemented the one-line lifecycle ordering fix, and ran verification

Checklist

  • Tests cover the change and fail without it
  • Lint, format, main-process typecheck, and the affected suite pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No
中文

摘要

在退出自有的本地 Runtime Host 前先销毁主 Renderer,避免正常退出时 Renderer IPC 与 handler 清理发生竞态,并消除退出日志中误导性的 No handler registered 错误

验证

  • 使用隔离 profile 启动 npm run dev,通过 macOS 应用退出事件退出;日志只保留本地 Host 正常退出记录
  • npx tsc -p apps/desktop/tsconfig.main.json --noEmit
  • App quit coordinator 测试:6 项通过
  • npm run lint
  • npm run format:check
  • 仓库整体 typecheck 仍被当前 origin/mainruntime-host-session-catalog.tsDesktopSessionSummary.id 错误阻断

AI 使用

  • 没有生成式工具作出实质性贡献
  • 生成式工具作出了实质性贡献

工具及范围:Codex 调查退出竞态、实现一行生命周期顺序修复并完成验证

检查清单

  • 测试覆盖该变更,且在没有该变更时会失败
  • lint、format、Main 进程 typecheck 及相关测试均在本地通过

此 PR 是否改变行为?

  • 是——已在摘要中说明

@Astro-Han Astro-Han 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.

I reviewed this head and found no blocking issues on code.

Fixes quit sequence (destroys renderer before retiring Host) and moves prior-crash notice to toast with evidence-on-read. Hosted test: FAILURE on composer-plus-menu-stability is the known race fixed in #3836 (this branch lacks that fix) — not attributable.

No P0-P3 on code.

简体中文代码无阻断,CI 红与本改动无关。

Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.

Destroy the main window before retiring the local Runtime Host so the renderer cannot send IPC after its handlers are removed.

Generated-by: Codex
@M4n5ter
M4n5ter force-pushed the fix/quiet-desktop-quit branch from ca7d2ae to 413ee07 Compare August 26, 2026 01:58

@Astro-Han Astro-Han 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.

I reviewed this head and found no blocking issues.

Rebased onto #3836 fix; quit sequence and diagnostic toast still correct; hosted test and package both SUCCESS.

No P0-P3.


Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.

@Astro-Han Astro-Han 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.

APPROVE — 413ee07, no P0-P3, hosted test+package SUCCESS.


Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.

@Astro-Han
Astro-Han merged commit 45ca7c0 into main Aug 26, 2026
2 checks passed
@Astro-Han
Astro-Han deleted the fix/quiet-desktop-quit branch August 26, 2026 02:30
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