Skip to content

fix(desktop): treat teardown as cancellation - #4562

Open
Phoenix500526 wants to merge 1 commit into
apache:mainfrom
Phoenix500526:fix/pending-observation-teardown
Open

fix(desktop): treat teardown as cancellation#4562
Phoenix500526 wants to merge 1 commit into
apache:mainfrom
Phoenix500526:fix/pending-observation-teardown

Conversation

@Phoenix500526

Copy link
Copy Markdown
Contributor

Summary

Pending Session and transcript observations rejected their readiness promises
when the renderer intentionally released them during startup. Those expected
teardowns escaped the Electron IPC handlers as errors.

Distinguish caller-initiated cancellation from genuine initialization failure,
then carry an explicit ready or cancelled result across the Main/Preload IPC
boundary. Preload now stops cancelled listeners without reporting a Session as
seeded or reading a missing transcript result. Genuine seed and transcript-open
failures continue to reject unchanged.

Fixes #4434

Verification

  • npm --workspace @maka/desktop run typecheck
  • npm --workspace @maka/desktop run build:test
  • Related Session observation and IPC suites: 68 passed
  • Session observation release suite: 1 passed
  • npm --workspace @maka/desktop run check:architecture: 71 fixture tests
    passed and the renderer architecture check passed
  • Biome and diff checks passed for all changed files
  • Manual Edit & resend/reset reproduction no longer prints the pending
    observation handler errors

AI use

Select exactly one:

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

Tool(s) and scope: OpenAI Codex implemented the cancellation contract and
regression tests, then reviewed and verified the resulting diff.

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
  • No

Pending renderer teardown is an expected observation outcome.
Represent it explicitly across IPC so Electron does not report a
handler failure or expose an empty success value.

CLOSES apache#4434
Generated-by: OpenAI Codex

Signed-off-by: Jiawei Zhao <Phoenix500526@163.com>
@github-actions github-actions Bot added the effort/M Under 500 readable lines label Sep 2, 2026
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.

fix(desktop): treat pending observation teardown as cancellation

1 participant