GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(desktop): refresh queued updates before install by SunkenInTime · Pull Request #6269 · pingdotgg/t3code

fix(desktop): refresh queued updates before install #6269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
shivamhwp merged 9 commits into pingdotgg:main from SunkenInTime:t3code/fix-windows-update-path
Aug 19, 2026

Uh oh!

There was an error while loading. Please reload this page.

Merged

fix(desktop): refresh queued updates before install #6269

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit Hold shift + click to select a range
6413b0f
fix(desktop): refresh queued updates before install
SunkenInTime Aug 12, 2026
1e76c27
fix(desktop): serialize update actions
SunkenInTime Aug 12, 2026
95b8bc6
fix(desktop): preserve queued update actions
SunkenInTime Aug 12, 2026
867d21b
fix(desktop): install queued update after errors
SunkenInTime Aug 12, 2026
ea59528
fix(desktop): serialize update channel changes
SunkenInTime Aug 12, 2026
a687a15
Merge branch 'main' into t3code/fix-windows-update-path
shivamhwp Aug 19, 2026
827378a
test(desktop): cover updater action lock release
shivamhwp Aug 19, 2026
4427ba0
fix(desktop): preserve queued update after feed refresh
shivamhwp Aug 19, 2026
0aad9b3
Merge branch 'main' into t3code/fix-windows-update-path
shivamhwp Aug 19, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

Some comments aren't visible on the classic Files Changed page.

There are no files selected for viewing

35 changes: 35 additions & 0 deletions 35 apps/desktop/src/updates/DesktopUpdates.test.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,41 @@ describe("DesktopUpdates", () => {
).pipe(Effect.provide(Layer.merge(TestClock.layer(), harness.layer)));
});

it.effect("checks for newer releases after an update has been downloaded", () => {
const harness = makeHarness();

return Effect.scoped(
Effect.gen(function* () {
const updates = yield* DesktopUpdates.DesktopUpdates;
yield* updates.configure;

harness.emit("update-downloaded", { version: "1.2.4" });
yield* flushCallbacks;

const result = yield* updates.check("poll");
assert.isTrue(result.checked);

harness.emit("update-available", { version: "1.2.4" });
yield* flushCallbacks;

const unchangedState = yield* updates.getState;
assert.equal(unchangedState.status, "downloaded");
assert.equal(unchangedState.downloadedVersion, "1.2.4");

const nextResult = yield* updates.check("poll");
assert.isTrue(nextResult.checked);

harness.emit("update-available", { version: "1.2.5" });
yield* flushCallbacks;

const state = yield* updates.getState;
assert.equal(state.status, "available");
assert.equal(state.availableVersion, "1.2.5");
assert.isNull(state.downloadedVersion);
}),
).pipe(Effect.provide(Layer.merge(TestClock.layer(), harness.layer)));
});

it.effect("keeps raw updater event failures out of update state", () => {
const harness = makeHarness();
const cause = new Error(
Expand Down
2 changes: 1 addition & 1 deletion 2 apps/desktop/src/updates/DesktopUpdates.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ export const make = Effect.gen(function* () {
if (yield* Ref.get(updateCheckInFlightRef)) return false;

const state = yield* Ref.get(updateStateRef);
if (state.status === "downloading" || state.status === "downloaded") {
if (state.status === "downloading") {
Comment thread
macroscopeapp[bot] marked this conversation as resolved.
Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread
cursor[bot] marked this conversation as resolved.
Resolved

Uh oh!

There was an error while loading. Please reload this page.

yield* logUpdaterInfo("skipping update check while update is active", {
reason,
status: state.status,
Expand Down
48 changes: 48 additions & 0 deletions 48 apps/desktop/src/updates/updateMachine.test.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,54 @@ describe("updateMachine", () => {
expect(state.canRetry).toBe(true);
});

it("preserves an already-downloaded update while checking the feed", () => {
const downloadedState = {
...createInitialDesktopUpdateState("1.0.0", runtimeInfo, "latest"),
enabled: true,
status: "downloaded" as const,
availableVersion: "1.1.0",
downloadedVersion: "1.1.0",
releaseNotes: [{ version: "1.1.0", items: ["fix: queued update"] }],
downloadPercent: 100,
};
const checking = reduceDesktopUpdateStateOnCheckStart(
downloadedState,
"2026-03-04T00:00:00.000Z",
);
const failed = reduceDesktopUpdateStateOnCheckFailure(
checking,
"network unavailable",
"2026-03-04T00:00:01.000Z",
);

expect(checking.status).toBe("checking");
expect(checking.downloadedVersion).toBe("1.1.0");
expect(checking.releaseNotes).toEqual(downloadedState.releaseNotes);
expect(failed.status).toBe("downloaded");
expect(failed.downloadedVersion).toBe("1.1.0");
expect(failed.releaseNotes).toEqual(downloadedState.releaseNotes);
expect(failed.message).toBeNull();
});

it("keeps the installer when the feed still offers its version", () => {
const state = reduceDesktopUpdateStateOnUpdateAvailable(
{
...createInitialDesktopUpdateState("1.0.0", runtimeInfo, "latest"),
enabled: true,
status: "downloaded",
availableVersion: "1.1.0",
downloadedVersion: "1.1.0",
downloadPercent: 100,
},
"1.1.0",
"2026-03-04T00:00:00.000Z",
);

expect(state.status).toBe("downloaded");
expect(state.downloadedVersion).toBe("1.1.0");
expect(state.downloadPercent).toBe(100);
});

it("preserves available version on download failure for retry", () => {
const state = reduceDesktopUpdateStateOnDownloadFailure(
{
Expand Down
26 changes: 20 additions & 6 deletions 26 apps/desktop/src/updates/updateMachine.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,14 @@ export function reduceDesktopUpdateStateOnCheckStart(
state: DesktopUpdateState,
checkedAt: string,
): DesktopUpdateState {
const hasDownloadedUpdate = state.downloadedVersion !== null;
return {
...state,
status: "checking",
checkedAt,
releaseNotes: [],
releaseNotes: hasDownloadedUpdate ? state.releaseNotes : [],
message: null,
downloadPercent: null,
downloadPercent: hasDownloadedUpdate ? 100 : null,
errorContext: null,
canRetry: false,
};
Expand All @@ -60,6 +61,18 @@ export function reduceDesktopUpdateStateOnCheckFailure(
message: string,
checkedAt: string,
): DesktopUpdateState {
if (state.downloadedVersion !== null) {
return {
...state,
status: "downloaded",
message: null,
checkedAt,
downloadPercent: 100,
errorContext: null,
canRetry: true,
};
}

return {
...state,
status: "error",
Expand All @@ -77,17 +90,18 @@ export function reduceDesktopUpdateStateOnUpdateAvailable(
checkedAt: string,
releaseNotes: ReadonlyArray<DesktopUpdateReleaseNote> = [],
): DesktopUpdateState {
const isDownloadedVersion = state.downloadedVersion === version;
return {
...state,
status: "available",
status: isDownloadedVersion ? "downloaded" : "available",
availableVersion: version,
downloadedVersion: null,
downloadedVersion: isDownloadedVersion ? version : null,
releaseNotes,
Comment thread
SunkenInTime marked this conversation as resolved.
Resolved

Uh oh!

There was an error while loading. Please reload this page.

downloadPercent: null,
downloadPercent: isDownloadedVersion ? 100 : null,
checkedAt,
message: null,
errorContext: null,
canRetry: false,
canRetry: isDownloadedVersion,
};
}

Expand Down
19 changes: 15 additions & 4 deletions 19 apps/web/src/components/desktopUpdate.logic.test.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,25 @@ describe("desktop update button state", () => {
expect(getDesktopUpdateButtonTooltip(state)).toContain("Click to retry");
});

it("prefers install when a downloaded version already exists", () => {
it("prefers a newly available release over a stale downloaded version", () => {
const state: DesktopUpdateState = {
...baseState,
status: "available",
availableVersion: "1.2.0",
downloadedVersion: "1.1.0",
};
expect(resolveDesktopUpdateButtonAction(state)).toBe("download");
});

it("hides the install action while checking for a newer release", () => {
const state: DesktopUpdateState = {
...baseState,
status: "checking",
availableVersion: "1.1.0",
downloadedVersion: "1.1.0",
downloadPercent: 100,
};
expect(resolveDesktopUpdateButtonAction(state)).toBe("install");
expect(resolveDesktopUpdateButtonAction(state)).toBe("none");
});

it("hides the button for non-actionable check errors", () => {
Expand Down Expand Up @@ -290,15 +301,15 @@ describe("canCheckForUpdate", () => {
);
});

it("returns false once an update has been downloaded", () => {
it("returns true once an update has been downloaded so newer releases can be found", () => {
expect(
canCheckForUpdate({
...baseState,
status: "downloaded",
availableVersion: "1.1.0",
downloadedVersion: "1.1.0",
}),
).toBe(false);
).toBe(true);
});

it("returns true when idle", () => {
Expand Down
10 changes: 5 additions & 5 deletions 10 apps/web/src/components/desktopUpdate.logic.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ export function getDesktopUpdateReleaseUrl(version: string | null): string | nul
export function resolveDesktopUpdateButtonAction(
state: DesktopUpdateState,
): DesktopUpdateButtonAction {
if (state.downloadedVersion) {
if (
state.downloadedVersion &&
Comment thread
SunkenInTime marked this conversation as resolved.
Resolved

Uh oh!

There was an error while loading. Please reload this page.

(state.status === "downloaded" || state.errorContext === "install")
) {
return "install";
}
if (state.status === "available") {
Expand Down Expand Up @@ -125,9 +128,6 @@ export function shouldHighlightDesktopUpdateError(state: DesktopUpdateState | nu
export function canCheckForUpdate(state: DesktopUpdateState | null): boolean {
if (!state || !state.enabled) return false;
return (
state.status !== "checking" &&
state.status !== "downloading" &&
state.status !== "downloaded" &&
state.status !== "disabled"
state.status !== "checking" && state.status !== "downloading" && state.status !== "disabled"
);
}
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.