@devries-cameron20 / t3code-1 / commits / 605e8143e0
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Prevent redundant checks during desktop update download

- Skip desktop auto-update checks while an update is downloading or already downloaded - Subscribe to update-state events before initial fetch in sidebar to avoid stale state races

Julius Marminge committed Mar 3, 2026 at 19:21 UTC 605e8143e09229d1c825f33afa26d1f2c10d8459
2 files changed +14 -5
apps/desktop/src/main.ts
+6
@@ -576,6 +576,12 @@ function shouldEnableAutoUpdates(): boolean {
576
577 async function checkForUpdates(reason: string): Promise<void> {
578 if (!updaterConfigured || updateCheckInFlight) return;
579 + if (updateState.status === "downloading" || updateState.status === "downloaded") {
580 + console.info(
581 + `[desktop-updater] Skipping update check (${reason}) while status=${updateState.status}.`,
582 + );
583 + return;
584 + }
585 updateCheckInFlight = true;
586 setUpdateState({
587 status: "checking",
apps/web/src/components/Sidebar.tsx
+8 -5
@@ -812,18 +812,21 @@ export default function Sidebar() {
812 }
813
814 let disposed = false;
815 + let receivedSubscriptionUpdate = false;
816 + const unsubscribe = bridge.onUpdateState((nextState) => {
817 + if (disposed) return;
818 + receivedSubscriptionUpdate = true;
819 + setDesktopUpdateState(nextState);
820 + });
821 +
822 void bridge
823 .getUpdateState()
824 .then((nextState) => {
818 - if (disposed) return;
825 + if (disposed || receivedSubscriptionUpdate) return;
826 setDesktopUpdateState(nextState);
827 })
828 .catch(() => undefined);
829
823 - const unsubscribe = bridge.onUpdateState((nextState) => {
824 - setDesktopUpdateState(nextState);
825 - });
826 -
830 return () => {
831 disposed = true;
832 unsubscribe();