From f7e68e32d1c95215407a23d4ab533d3ccc6e18bf Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Thu, 10 Sep 2026 11:42:09 +0200 Subject: [PATCH] fix(desktop): restore Linux launcher identity (#4649) * fix(desktop): restore Linux launcher identity Electron now derives Linux window identity from the scoped package name before app startup. Pin the existing Paseo.desktop identity in packaged metadata and check the built archive in the packaged-app smoke test. * test(desktop): declare packaged smoke archive dependency * fix(desktop): update Nix hash for smoke dependency --- nix/npm-deps.hash | 2 +- package-lock.json | 1 + packages/desktop/e2e/packaged-app-smoke.js | 15 +++++++++++++++ packages/desktop/package.json | 4 +++- 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/nix/npm-deps.hash b/nix/npm-deps.hash index 9ad4290b4d..e838ca8391 100644 --- a/nix/npm-deps.hash +++ b/nix/npm-deps.hash @@ -1 +1 @@ -sha256-8P7kk9B2A81e13IIyyfo8fIoNGlrutfV/WGKAFHscUc= +sha256-j8U5S71SJoC+5yh7IjkadrRZaHOYeMsi1z8B6K7j4R4= diff --git a/package-lock.json b/package-lock.json index f8162e6c0d..1a94812378 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37538,6 +37538,7 @@ "zod": "^4.4.3" }, "devDependencies": { + "@electron/asar": "3.4.1", "@types/node": "24.6.0", "@types/ws": "^8.5.14", "electron": "44.2.0", diff --git a/packages/desktop/e2e/packaged-app-smoke.js b/packages/desktop/e2e/packaged-app-smoke.js index b07b75df4d..6a77538952 100644 --- a/packages/desktop/e2e/packaged-app-smoke.js +++ b/packages/desktop/e2e/packaged-app-smoke.js @@ -5,6 +5,7 @@ const os = require("node:os"); const path = require("node:path"); const { setTimeout: delay } = require("node:timers/promises"); const { chromium } = require("playwright"); +const { extractFile } = require("@electron/asar"); const EXECUTABLE_NAME = "Paseo"; const SMOKE_TIMEOUT_MS = 60_000; @@ -805,9 +806,23 @@ async function stopCliDaemon({ appPath, env }) { }); } +function assertLinuxDesktopIdentity(appPath) { + if (process.platform === "linux") { + const metadata = JSON.parse( + extractFile(path.join(appPath, "resources", "app.asar"), "package.json").toString(), + ); + if (metadata.desktopName !== `${EXECUTABLE_NAME}.desktop`) { + throw new Error( + `Packaged Linux desktop identity ${JSON.stringify(metadata.desktopName)} does not match ${EXECUTABLE_NAME}.desktop`, + ); + } + } +} + async function smokePackagedDesktopApp({ appPath }) { const executablePath = getExecutablePath(appPath); assertExecutable(executablePath, "Packaged app executable"); + assertLinuxDesktopIdentity(appPath); ensureLinuxSandboxPermissions(appPath); await smokeColdCliDaemonStart({ appPath }); diff --git a/packages/desktop/package.json b/packages/desktop/package.json index 84d71dfafa..11ebbb9cb7 100644 --- a/packages/desktop/package.json +++ b/packages/desktop/package.json @@ -35,6 +35,7 @@ "zod": "^4.4.3" }, "devDependencies": { + "@electron/asar": "3.4.1", "@types/node": "24.6.0", "@types/ws": "^8.5.14", "electron": "44.2.0", @@ -43,5 +44,6 @@ "unzip-crx-3": "^0.2.0", "vitest": "^4.1.6", "wait-on": "8.0.5" - } + }, + "desktopName": "Paseo.desktop" }