@devries-cameron20 / t3code-1 / commits / 05e3bcbc65
Fork 0

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

fix(desktop): keep preview releases out of the nightly update changelog (#11753)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

Julius Marminge committed Sep 14, 2026 at 09:15 UTC 05e3bcbc65d43adc70c900f176bec6c095b3b833
3 files changed +70 -7
apps/desktop/src/updates/DesktopUpdates.ts
+1
@@ -711,6 +711,7 @@ export const make = Effect.gen(function* () {
711 const { releaseNotes, omittedReleaseCount } = normalizeDesktopUpdateReleaseNotes(
712 info.releaseNotes,
713 info.version,
714 + state.channel,
715 );
716 yield* setState(
717 reduceDesktopUpdateStateOnUpdateAvailable(
apps/desktop/src/updates/releaseNotes.test.ts
+53 -4
@@ -21,6 +21,7 @@ describe("normalizeDesktopUpdateReleaseNotes", () => {
21 "**Full Changelog**: https://github.com/pingdotgg/t3code/compare/old...new",
22 ].join("\n"),
23 "0.0.36-nightly.20260828.1213",
24 + "nightly",
25 );
26
27 expect(result).toEqual({
@@ -50,6 +51,7 @@ describe("normalizeDesktopUpdateReleaseNotes", () => {
51 "<h2>New Contributors</h2><ul><li>@human made their first contribution</li></ul>" +
52 "<h2>Full Changelog</h2>",
53 "1.2.3",
54 + "latest",
55 );
56
57 expect(result).toEqual({
@@ -69,6 +71,7 @@ describe("normalizeDesktopUpdateReleaseNotes", () => {
71 },
72 ],
73 "1.2.4",
74 + "latest",
75 );
76
77 expect(result.releaseNotes).toEqual([
@@ -85,6 +88,7 @@ describe("normalizeDesktopUpdateReleaseNotes", () => {
88 { version: "1.2.1", note: "- Older release" },
89 ],
90 "1.2.3",
91 + "latest",
92 );
93
94 expect(result).toEqual({
@@ -96,6 +100,42 @@ describe("normalizeDesktopUpdateReleaseNotes", () => {
100 });
101 });
102
103 + it("drops releases from other trains before grouping on nightly", () => {
104 + // electron-updater's full changelog is "every version above the running
105 + // one", and preview sorts above nightly, so the preview cuts come first.
106 + const releaseNotes = [
107 + { version: "0.0.41-preview.20260914.1683", note: "- Maintainer test build" },
108 + { version: "0.0.41-preview.20260913.1669", note: "- Maintainer test build" },
109 + { version: "0.0.41-nightly.20260914.1707", note: "- Nightly change 2" },
110 + { version: "0.0.41-nightly.20260914.1700", note: "- Nightly change 1" },
111 + ];
112 +
113 + const result = normalizeDesktopUpdateReleaseNotes(
114 + releaseNotes,
115 + "0.0.41-nightly.20260914.1707",
116 + "nightly",
117 + );
118 +
119 + expect(result.releaseNotes.map(({ version }) => version)).toEqual([
120 + "0.0.41-nightly.20260914.1707",
121 + "0.0.41-nightly.20260914.1700",
122 + ]);
123 + expect(result.omittedReleaseCount).toBe(0);
124 + });
125 +
126 + it("keeps only stable releases on the latest channel", () => {
127 + const result = normalizeDesktopUpdateReleaseNotes(
128 + [
129 + { version: "0.0.42", note: "- Stable change" },
130 + { version: "0.0.42-nightly.20260915.1710", note: "- Nightly change" },
131 + ],
132 + "0.0.42",
133 + "latest",
134 + );
135 +
136 + expect(result.releaseNotes.map(({ version }) => version)).toEqual(["0.0.42"]);
137 + });
138 +
139 it("counts valid groups before applying the six-release limit", () => {
140 const releaseNotes = [
141 { version: "1.3.9", note: "- Change 9" },
@@ -108,7 +148,7 @@ describe("normalizeDesktopUpdateReleaseNotes", () => {
148 { version: "1.3.2", note: "- Change 2" },
149 ];
150
111 - const result = normalizeDesktopUpdateReleaseNotes(releaseNotes, "1.3.9");
151 + const result = normalizeDesktopUpdateReleaseNotes(releaseNotes, "1.3.9", "latest");
152
153 expect(result.releaseNotes.map(({ version }) => version)).toEqual([
154 "1.3.9",
@@ -122,7 +162,11 @@ describe("normalizeDesktopUpdateReleaseNotes", () => {
162 });
163
164 it("decodes valid HTML entities", () => {
125 - const result = normalizeDesktopUpdateReleaseNotes("- Fix &amp; polish &#128512;", "1.0.0");
165 + const result = normalizeDesktopUpdateReleaseNotes(
166 + "- Fix &amp; polish &#128512;",
167 + "1.0.0",
168 + "latest",
169 + );
170 expect(result).toEqual({
171 releaseNotes: [{ version: "1.0.0", items: ["Fix & polish 😀"], totalItems: 1 }],
172 omittedReleaseCount: 0,
@@ -140,6 +184,7 @@ describe("normalizeDesktopUpdateReleaseNotes", () => {
184 null,
185 ],
186 "1.2.3",
187 + "latest",
188 );
189
190 expect(result).toEqual({
@@ -149,14 +194,18 @@ describe("normalizeDesktopUpdateReleaseNotes", () => {
194 });
195
196 it("returns an empty result for an invalid payload", () => {
152 - expect(normalizeDesktopUpdateReleaseNotes({ note: "- Invalid" }, "1.0.0")).toEqual({
197 + expect(normalizeDesktopUpdateReleaseNotes({ note: "- Invalid" }, "1.0.0", "latest")).toEqual({
198 releaseNotes: [],
199 omittedReleaseCount: 0,
200 });
201 });
202
203 it("does not throw on out-of-range numeric entities and keeps the literal", () => {
159 - const result = normalizeDesktopUpdateReleaseNotes("- Broken entity &#9999999999;", "1.0.0");
204 + const result = normalizeDesktopUpdateReleaseNotes(
205 + "- Broken entity &#9999999999;",
206 + "1.0.0",
207 + "latest",
208 + );
209 expect(result).toEqual({
210 releaseNotes: [{ version: "1.0.0", items: ["Broken entity &#9999999999;"], totalItems: 1 }],
211 omittedReleaseCount: 0,
apps/desktop/src/updates/releaseNotes.ts
+16 -3
@@ -1,4 +1,6 @@
1 -import type { DesktopUpdateReleaseNote } from "@t3tools/contracts";
1 +import type { DesktopUpdateChannel, DesktopUpdateReleaseNote } from "@t3tools/contracts";
2 +
3 +import { resolveDefaultDesktopUpdateChannel } from "./updateChannels.ts";
4
5 interface ElectronReleaseNoteInfo {
6 readonly version: string;
@@ -122,16 +124,27 @@ interface NormalizedDesktopUpdateReleaseNotes {
124 readonly omittedReleaseCount: number;
125 }
126
127 +/**
128 + * Turns electron-updater's release notes into the groups the popover shows.
129 + * With `fullChangelog` on (nightly), electron-updater collects every GitHub
130 + * release whose version is semver-greater than the running one, whatever
131 + * train it belongs to; a maintainers' `-preview.` cut sorts above every
132 + * `-nightly.` of the same base version and would lead the list. Only
133 + * releases on the channel being followed are kept, the same test the
134 + * updater applies to the offered version itself.
135 + */
136 export function normalizeDesktopUpdateReleaseNotes(
137 releaseNotes: unknown,
138 fallbackVersion: string,
139 + channel: DesktopUpdateChannel,
140 ): NormalizedDesktopUpdateReleaseNotes {
129 - const rawNotes =
141 + const rawNotes = (
142 typeof releaseNotes === "string"
143 ? [{ version: fallbackVersion, note: releaseNotes }]
144 : Array.isArray(releaseNotes)
145 ? releaseNotes.filter(isElectronReleaseNoteInfo)
134 - : [];
146 + : []
147 + ).filter((entry) => resolveDefaultDesktopUpdateChannel(entry.version) === channel);
148
149 const normalizedNotes = rawNotes.flatMap((entry) => {
150 const { items, totalItems } = extractReleaseNoteItems(entry.note);