From 3f39f803558f9dac12449aede73b5f74a829306a Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Fri, 14 Aug 2026 13:25:55 -0700 Subject: [PATCH] fix(update-check): never flag local-ahead checkouts as updates (desktop SSH sibling) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Same local-ahead blind spot as the CLI SSH fast path, on the desktop's passive SSH-official check: tips differ but ahead_by == 0 means the remote tip is reachable from HEAD (carried local commit). Treat that as up to date instead of 'update available' — the nudge toward hermes update is exactly what wipes carried work. Widens andyst-dev's #84860 to the desktop sibling site. --- apps/desktop/electron/main.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/desktop/electron/main.ts b/apps/desktop/electron/main.ts index 714643c3cc..64d076d714 100644 --- a/apps/desktop/electron/main.ts +++ b/apps/desktop/electron/main.ts @@ -2578,17 +2578,22 @@ async function checkUpdates() { // fabricate a "1 commit behind". Recover the exact count via the GitHub // compare API when possible; otherwise behind stays null ("update // available, count unknown") and updateAvailable carries the signal. - const upToDate = Boolean(currentSha && currentSha === targetSha) + // ahead_by === 0 with differing tips means the remote tip is reachable + // from our HEAD — a local carried commit sitting AHEAD, not behind: + // flagging that as an update nudges the user into wiping their work. + const tipsEqual = Boolean(currentSha && currentSha === targetSha) - const sshBehind = upToDate + const sshBehind = tipsEqual ? 0 : await fetchCompareBehindCount({ currentSha, originUrl: OFFICIAL_REPO_HTTPS_URL, targetSha }) + const upToDate = tipsEqual || sshBehind === 0 + return { supported: true, branch, currentBranch, - behind: sshBehind, + behind: upToDate ? 0 : sshBehind, updateAvailable: !upToDate, currentSha, targetSha,