Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): generate valid User-Agent that follows RFC 9110 guidelines #17264

Mergedjztmanyl(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/17264/headmerged by Yash-Singh1(GitHub profile, opens in a new tab) View on GitHub

Showing 4 changed files with 75 additions and 3 deletions (loading 1).

x
0 of 4 viewed, 4 left
34 additions and 1 deletionapps/desktop/src/app/DesktopAppIdentity.test.tsModified
View file
@@ -217,7 +217,7 @@
const identity = yield* DesktopAppIdentity.DesktopAppIdentity;
yield* identity.configure;
​
- assert.deepEqual(calls.setName, ["T3 Code (Alpha)"]);
+ assert.deepEqual(calls.setName, ["T3 Code Alpha"]);
assert.equal(calls.setAboutPanelOptions[0]?.applicationName, "T3 Code (Alpha)");
assert.equal(calls.setAboutPanelOptions[0]?.applicationVersion, "1.2.3");
assert.equal(calls.setAboutPanelOptions[0]?.version, "0123456789ab");
@@ -237,6 +237,39 @@
});
​
+ it.effect.each([
+ { stage: "Alpha", environment: {} },
+ {
+ stage: "Nightly",
+ environment: { appVersion: "0.0.43-nightly.20260929.2428" },
+ },
+ {
+ stage: "Dev",
+ environment: { env: { VITE_DEV_SERVER_URL: "http://localhost:5173" } },
+ },
+ ])("uses a valid native User-Agent product name for $stage", ({ stage, environment }) => {
+ const calls: ElectronAppCalls = {
+ setAboutPanelOptions: [],
+ setDockIcon: [],
+ setName: [],
+ };