Skip to content

fix(desktop): complete the update restart flow - #126

Merged
elkaix merged 1 commit into
mainfrom
fix/desktop-update-quit-lifecycle
Aug 18, 2026
Merged

fix(desktop): complete the update restart flow#126
elkaix merged 1 commit into
mainfrom
fix/desktop-update-quit-lifecycle

Conversation

@elkaix

@elkaix elkaix commented Aug 17, 2026

Copy link
Copy Markdown
Member

Related Issue

No issue. This bug was reported directly with macOS screenshots and a reproducible update failure.

Problem

The update restart closed Electron windows before the normal quit event. The tray close handler hid the window, and the bundled local server remained active. macOS ShipIt then found two running Pythinker processes and canceled the installation. The remaining app could show a main-process connection error.

What changed

  • Start the shared desktop shutdown path on Electron update quits, before windows close.
  • Use one Update toast action on Windows and macOS. It downloads when needed, then closes, installs, and restarts automatically.
  • Keep Skip as the alternative and document the flow.
  • Add updater and toast regression coverage plus a patch changeset.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

Summary by CodeRabbit

  • Bug Fixes

    • Desktop updates now download, install, close, and restart the app through a single Update action.
    • Update installation waits for the download to finish before restarting.
  • Documentation

    • Added guidance for the desktop update prompt, including Update and Skip actions.

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: e675fa41-aa06-4fc4-9fa8-066ae8cb15dd

📥 Commits

Reviewing files that changed from the base of the PR and between 0e9ae30 and 7e0c280.

📒 Files selected for processing (8)
  • .changeset/fix-desktop-update-restart.md
  • apps/desktop/src/main.ts
  • apps/desktop/src/updater.ts
  • apps/desktop/tests/updater.spec.ts
  • apps/pythinker-web/src/components/UpdateToast.vue
  • apps/pythinker-web/src/i18n/locales/en/update.ts
  • apps/pythinker-web/test/update-toast.test.ts
  • docs/guides/desktop.md

Included review availability: Your plan includes up to 3 reviews per rolling hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

The desktop update prompt now uses one Update action. The updater downloads available releases, installs them after download completion, closes the application, and restarts it. Tests and desktop documentation cover the new flow.

Changes

Desktop update flow

Layer / File(s) Summary
Deferred update installation
apps/desktop/src/updater.ts, apps/desktop/src/main.ts, apps/desktop/tests/updater.spec.ts
The updater downloads available updates before installation and waits for download completion. Update-triggered quitting starts application teardown. Tests cover the deferred installation flow.
Unified update prompt
apps/pythinker-web/src/components/UpdateToast.vue, apps/pythinker-web/src/i18n/locales/en/update.ts, apps/pythinker-web/test/update-toast.test.ts, docs/guides/desktop.md, .changeset/fix-desktop-update-restart.md
The prompt always calls quitAndInstall() and displays Update. Tests and documentation describe the complete update workflow. The changeset records the patch release.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 7e0c2

The PR completes the desktop update restart flow and adds focused regression coverage; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title uses the fix prefix, stays within 72 characters, and clearly describes the update restart flow in imperative mood.
Description check ✅ Passed The description includes all required sections, explains the problem and changes, and completes the checklist with tests, changeset, and documentation.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Aug 17, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@pymodel/pythinker-code@7e0c280
npx https://pkg.pr.new/@pymodel/pythinker-code@7e0c280

commit: 7e0c280

@elkaix
elkaix merged commit a447a2c into main Aug 18, 2026
13 checks passed
@elkaix
elkaix deleted the fix/desktop-update-quit-lifecycle branch August 18, 2026 00:08
elkaix pushed a commit that referenced this pull request Aug 18, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @pymodel/pythinker-code@0.21.2

### Patch Changes

- [#126](#126)
[`a447a2c`](a447a2c)
- Fix desktop update prompts so one action downloads, closes, installs,
and restarts the app.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

1 participant