Skip to content

fix(desktop): recover failed update installs - #153

Merged
leoisadev1 merged 1 commit into
mainfrom
fix/desktop-update-recovery
Sep 2, 2026
Merged

fix(desktop): recover failed update installs#153
leoisadev1 merged 1 commit into
mainfrom
fix/desktop-update-recovery

Conversation

@leoisadev1

Copy link
Copy Markdown
Member

Packaged Akeru inherited an ambient T3CODE_PORT, which could send the renderer to another local server while its own backend failed to bind. A failed update install could then leave the old desktop process alive after its backends and windows had stopped.

Packaged builds now ignore the development-only port override and use the existing free-port selection. If the updater reports an install failure, the desktop clears its quitting state and restarts every registered backend so the main window can recover. Focused tests cover both failure paths.

Model: gpt-5.6-sol
Harness: Codex harness in T3 Code

@vercel

vercel Bot commented Sep 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
akeru-bot-landing Skipped Skipped Sep 2, 2026 11:50pm UTC

Request Review

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XS labels Sep 2, 2026
@leoisadev1
leoisadev1 merged commit 68bc589 into main Sep 2, 2026
11 checks passed
@leoisadev1
leoisadev1 deleted the fix/desktop-update-recovery branch September 2, 2026 23:57
@greptile-apps

greptile-apps Bot commented Sep 2, 2026

Copy link
Copy Markdown

Greptile Summary

This change prevents packaged desktop builds from inheriting the development backend port and restores backends when updater error events interrupt installation. A direct quitAndInstall rejection still leaves previously stopped backends offline, so a user whose update installation fails can be left with a running desktop process but no usable backend or window.

Confidence Score: 4/5

Not safe to merge until the direct installation-rejection handler restores the backends it stopped.

A focused desktop test directly exercised the typed installer-rejection path and observed that backend recovery was never invoked after shutdown.

Files Needing Attention: apps/desktop/src/updates/DesktopUpdates.ts needs recovery logic in the ElectronUpdaterQuitAndInstallError catch path, with a regression test in DesktopUpdates.test.ts.

T-Rex T-Rex Logs

What T-Rex did

  • T-Rex produced proof for the posted P1 finding.
  • T-Rex produced proof for a second posted P1 finding.
  • T-Rex performed general contract validation on the ElectronUpdaterQuitAndInstallError path and ran the test command, noting that the recovery expectation fails while the current implementation passes (59 files and 583 tests).

View all artifacts

T-Rex Ran code and verified through T-Rex

Comments Outside Diff (2)

  1. apps/desktop/src/updates/DesktopUpdates.ts, line 507-520 (link)

    P1 Installer rejection leaves backends stopped

    The installation flow stops all pooled backends before closing windows. When quitAndInstall rejects with ElectronUpdaterQuitAndInstallError, this handler clears the update action and quitting state but does not restart those stopped instances. The process remains alive after the failed installation without a usable backend or window. Restore every instance from pool.list here, matching the recovery already performed for installation-related updater error events.

    Artifacts

    Focused DesktopUpdates rejection-branch test source

    • The authored focused mock harness extension rejects quitAndInstall after backend shutdown and observes the backend start counter, providing the executable reproduction.

    Recovery expectation failure before the fix

    • Running the focused desktop test with the required restart expectation fails because the observed backend start count is zero, proving the missing recovery.

    Current behavior assertion pass

    • Running the same focused rejection path with the observed zero-start assertion passes all desktop tests, confirming the current behavior.

    View artifacts

    T-Rex Ran code and verified through T-Rex

    Fix in Claude Code

  2. General comment

    P1 quitAndInstall rejection does not restore stopped backends

    • Bug
      • The install flow stops all pooled backends before closing windows. If the typed ElectronUpdaterQuitAndInstallError is caught, the handler clears the action and quitting flag and reports install failure, but never calls each instance's start; the exercised mock observed zero starts.
    • Cause
      • The dedicated catch at apps/desktop/src/updates/DesktopUpdates.ts:507-520 omits the backend-restart sequence implemented for install-associated updater error events at lines 635-642.
    • Fix
      • After resetInstallAction in the typed catch, obtain pool.list and run instance.start for all instances with unbounded concurrency before returning the install failure state; retain a focused regression test that expects the restart count to be one.

    T-Rex Ran code and verified through T-Rex

Fix all with Greploop Fix All in Claude Code

Reviews (1): Last reviewed commit: "fix(desktop): recover failed update inst..." | Re-trigger Greptile

@github-actions github-actions Bot mentioned this pull request Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant