From cfaa46fcae63e23bd6a9453c2453979628040a92 Mon Sep 17 00:00:00 2001 From: yoniebans Date: Sat, 6 Jun 2026 21:28:39 +0200 Subject: [PATCH] fix(desktop): pre-check backend updates in poller; client button first MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two follow-ups from testing the two-button bar: - The background poller and focus handler only checked the client, so the backend behind-count and changelog stayed empty until the user opened the overlay — and the overlay's first render then hit the empty-commits fallback ('Improvements and fixes') instead of the real changelog. Check the backend alongside the client on poller start, interval, and focus so its state is ready before the button is clicked. - Order the status bar client-first, backend-second. --- .../src/app/shell/hooks/use-statusbar-items.tsx | 4 ++-- apps/desktop/src/store/updates.ts | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/apps/desktop/src/app/shell/hooks/use-statusbar-items.tsx b/apps/desktop/src/app/shell/hooks/use-statusbar-items.tsx index 0e5c8e2c8b5..c471d0f517a 100644 --- a/apps/desktop/src/app/shell/hooks/use-statusbar-items.tsx +++ b/apps/desktop/src/app/shell/hooks/use-statusbar-items.tsx @@ -442,8 +442,8 @@ export function useStatusbarItems({ variant: 'action' as const }) }, - ...(backendVersionItem ? [backendVersionItem] : []), - clientVersionItem + clientVersionItem, + ...(backendVersionItem ? [backendVersionItem] : []) ], [ busy, diff --git a/apps/desktop/src/store/updates.ts b/apps/desktop/src/store/updates.ts index 0a676d13819..80746bf4bf6 100644 --- a/apps/desktop/src/store/updates.ts +++ b/apps/desktop/src/store/updates.ts @@ -398,11 +398,15 @@ export function startUpdatePoller(): void { pollerStarted = true void checkUpdates() + void checkBackendUpdates() void refreshDesktopVersion() bridge.onProgress(ingestProgress) window.addEventListener('focus', onFocus) - backgroundTimer = setInterval(() => void checkUpdates(), 30 * 60 * 1000) + backgroundTimer = setInterval(() => { + void checkUpdates() + void checkBackendUpdates() + }, 30 * 60 * 1000) } export function stopUpdatePoller(): void { @@ -424,8 +428,6 @@ function onFocus() { lastFocusAt = now void checkUpdates() - // Cheap and safe to re-read on every (throttled) focus: the user may have - // updated Hermes from another window/CLI between focuses, and About should - // catch up without forcing a restart. + void checkBackendUpdates() void refreshDesktopVersion() }