From e8aedee486d90baba8f609038f7f53a3cdf0396a Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Tue, 27 Oct 2026 02:14:04 +0000 Subject: [PATCH 1/3] test(desktop): reproduce #8944 AppImage updates breaking versioned-name launchers These tests reproduce #8944: updatable AppImages are named with their version, so electron-updater writes each update under a new name and deletes the installed file, leaving symlinks and desktop entries dangling. Co-Authored-By: Claude Opus 5.5 --- scripts/build-desktop-artifact.test.ts | 42 ++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/scripts/build-desktop-artifact.test.ts b/scripts/build-desktop-artifact.test.ts index 6ad4413adb567..cfb5d09b232f6 100644 --- a/scripts/build-desktop-artifact.test.ts +++ b/scripts/build-desktop-artifact.test.ts @@ -523,6 +523,48 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => { ), ); + // electron-updater keeps the installed AppImage path only when its name has no x.y.z version. + it.effect("names updatable AppImages without a version and apart per channel", () => + Effect.gen(function* () { + const appImageFileName = (version: string) => + createBuildConfig( + "linux", + "AppImage", + version, + false, + false, + undefined, + undefined, + false, + "x64", + ).pipe( + Effect.map((config) => { + const pattern = + (config.appImage as { artifactName?: string } | undefined)?.artifactName ?? + (config.linux as { artifactName?: string }).artifactName ?? + (config.artifactName as string); + return pattern + .replaceAll("${version}", version) + .replaceAll("${arch}", "x86_64") + .replaceAll("${ext}", "AppImage"); + }), + ); + + const stable = yield* appImageFileName("0.0.37"); + const nightly = yield* appImageFileName("0.0.38-nightly.20261026.3740"); + + assert.notMatch(stable, /\d+\.\d+\.\d+/); + assert.notMatch(nightly, /\d+\.\d+\.\d+/); + assert.notEqual(stable, nightly); + }).pipe( + Effect.provide( + ConfigProvider.layer( + ConfigProvider.fromEnv({ env: { GITHUB_REPOSITORY: "pingdotgg/t3code" } }), + ), + ), + ), + ); + // pnpm writes "set this to true or false" placeholders into allowBuilds when a // tarball changes. pnpm ignores them, but the release build decode rejects them. it.effect("decodes the repo allowBuilds and every file: tarball it names exists", () => From 91b9c30068b76ef277d5b870e4e3b80dadb2b856 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Tue, 27 Oct 2026 02:53:03 +0000 Subject: [PATCH 2/3] fix(desktop): AppImage updates keep their filename electron-updater replaces an installed AppImage in place only when its name has no x.y.z version. The AppImage was published as T3-Code--.AppImage, so every update landed under a new name and deleted the old file, breaking symlinks, desktop entries and dock pins. Builds that publish an update feed now name the AppImage T3-Code-.AppImage (stable) or T3-Code-Nightly-.AppImage (nightly). Preview builds and every other artifact keep the versioned name. The AUR release script and PKGBUILDs download the new asset name and keep a versioned local source name. Fixes pingdotgg/t3code#8944 Co-Authored-By: Claude Opus 5.5 --- packaging/aur/scripts/release.sh | 3 ++- packaging/aur/t3code-bin/PKGBUILD | 2 +- packaging/aur/t3code-nightly-bin/PKGBUILD | 2 +- scripts/build-desktop-artifact.ts | 7 +++++++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/packaging/aur/scripts/release.sh b/packaging/aur/scripts/release.sh index be07391db6e7f..2bfef42dd31de 100755 --- a/packaging/aur/scripts/release.sh +++ b/packaging/aur/scripts/release.sh @@ -8,8 +8,10 @@ pkgrel="${PKGREL:-1}" if [[ "$tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then pkgname='t3code-bin' + asset_name='T3-Code-x86_64.AppImage' elif [[ "$tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+-nightly\.[0-9]{8}\.[0-9]+$ ]]; then pkgname='t3code-nightly-bin' + asset_name='T3-Code-Nightly-x86_64.AppImage' else echo "Release $tag does not publish an AUR package." exit 0 @@ -17,7 +19,6 @@ fi version="${tag#v}" pkgver="${version//-/_}" -asset_name="T3-Code-${version}-x86_64.AppImage" release_json="$(gh api "repos/$repo/releases/tags/$tag")" asset_digest="$(jq -r --arg name "$asset_name" \ '.assets[] | select(.name == $name) | .digest' <<<"$release_json")" diff --git a/packaging/aur/t3code-bin/PKGBUILD b/packaging/aur/t3code-bin/PKGBUILD index c5219666bf08b..202aa418c5573 100644 --- a/packaging/aur/t3code-bin/PKGBUILD +++ b/packaging/aur/t3code-bin/PKGBUILD @@ -45,7 +45,7 @@ options=('!debug' '!strip') _appimage="T3-Code-${pkgver}-x86_64.AppImage" source=( - "$_appimage::https://github.com/pingdotgg/t3code/releases/download/v${pkgver}/$_appimage" + "$_appimage::https://github.com/pingdotgg/t3code/releases/download/v${pkgver}/T3-Code-x86_64.AppImage" "${pkgname}-${pkgver}-LICENSE::https://raw.githubusercontent.com/pingdotgg/t3code/v${pkgver}/LICENSE" ) sha256sums=( diff --git a/packaging/aur/t3code-nightly-bin/PKGBUILD b/packaging/aur/t3code-nightly-bin/PKGBUILD index f3b61c7d5223e..22a7fa9287c10 100644 --- a/packaging/aur/t3code-nightly-bin/PKGBUILD +++ b/packaging/aur/t3code-nightly-bin/PKGBUILD @@ -46,7 +46,7 @@ options=('!debug' '!strip') _upstream_version="${pkgver/_nightly./-nightly.}" _appimage="T3-Code-${_upstream_version}-x86_64.AppImage" source=( - "$_appimage::https://github.com/pingdotgg/t3code/releases/download/v${_upstream_version}/$_appimage" + "$_appimage::https://github.com/pingdotgg/t3code/releases/download/v${_upstream_version}/T3-Code-Nightly-x86_64.AppImage" "${pkgname}-${pkgver}-LICENSE::https://raw.githubusercontent.com/pingdotgg/t3code/v${_upstream_version}/LICENSE" ) sha256sums=( diff --git a/scripts/build-desktop-artifact.ts b/scripts/build-desktop-artifact.ts index ac2ed7826f77c..7a0352fcbfff3 100644 --- a/scripts/build-desktop-artifact.ts +++ b/scripts/build-desktop-artifact.ts @@ -2908,6 +2908,13 @@ export const createBuildConfig = Effect.fn("createBuildConfig")(function* ( }, }, }; + // electron-updater replaces an installed AppImage in place only when its name has no x.y.z version. + if (buildConfig.publish) { + buildConfig.appImage = { + artifactName: + updateChannel === "nightly" ? "T3-Code-Nightly-${arch}.${ext}" : "T3-Code-${arch}.${ext}", + }; + } buildConfig.deb = { // FPM runs outside the staged app directory, so source paths must be absolute. fpm: [ From 1902fefb5a2225bda862a4a22b0e597e4e30ec7c Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Tue, 27 Oct 2026 03:03:58 +0000 Subject: [PATCH 3/3] fix(aur): package the AppImage name each release published Releases before the AppImage rename publish a versioned asset, so the pinned PKGBUILDs and republishing an older tag kept pointing at a file those releases never had. release.sh now picks whichever name the release published and writes it into the PKGBUILD. Co-Authored-By: Claude Opus 5.5 --- packaging/aur/scripts/release.sh | 13 +++++++++---- packaging/aur/t3code-bin/PKGBUILD | 3 ++- packaging/aur/t3code-nightly-bin/PKGBUILD | 3 ++- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/packaging/aur/scripts/release.sh b/packaging/aur/scripts/release.sh index 2bfef42dd31de..c4b6b52168e83 100755 --- a/packaging/aur/scripts/release.sh +++ b/packaging/aur/scripts/release.sh @@ -20,12 +20,16 @@ fi version="${tag#v}" pkgver="${version//-/_}" release_json="$(gh api "repos/$repo/releases/tags/$tag")" -asset_digest="$(jq -r --arg name "$asset_name" \ - '.assets[] | select(.name == $name) | .digest' <<<"$release_json")" -appimage_sha256="${asset_digest#sha256:}" +# Older releases publish the AppImage under a versioned name. +for asset_name in "$asset_name" "T3-Code-${version}-x86_64.AppImage"; do + asset_digest="$(jq -r --arg name "$asset_name" \ + '.assets[] | select(.name == $name) | .digest' <<<"$release_json")" + appimage_sha256="${asset_digest#sha256:}" + [[ "$appimage_sha256" =~ ^[0-9a-f]{64}$ ]] && break +done if [[ ! "$appimage_sha256" =~ ^[0-9a-f]{64}$ ]]; then - echo "Release $tag is missing $asset_name or its SHA-256 digest." >&2 + echo "Release $tag is missing its x86_64 AppImage or its SHA-256 digest." >&2 exit 1 fi @@ -40,6 +44,7 @@ cd "$package_dir" sed -Ei \ -e "s/^pkgver=.*/pkgver=$pkgver/" \ -e "s/^pkgrel=.*/pkgrel=$pkgrel/" \ + -e "s/^_asset=.*/_asset='$asset_name'/" \ -e "/# AppImage$/s/'[0-9a-f]{64}'/'$appimage_sha256'/" \ -e "/# upstream license$/s/'[0-9a-f]{64}'/'$license_sha256'/" \ PKGBUILD diff --git a/packaging/aur/t3code-bin/PKGBUILD b/packaging/aur/t3code-bin/PKGBUILD index 202aa418c5573..b15e44d45b44d 100644 --- a/packaging/aur/t3code-bin/PKGBUILD +++ b/packaging/aur/t3code-bin/PKGBUILD @@ -44,8 +44,9 @@ conflicts=('t3code') options=('!debug' '!strip') _appimage="T3-Code-${pkgver}-x86_64.AppImage" +_asset="$_appimage" source=( - "$_appimage::https://github.com/pingdotgg/t3code/releases/download/v${pkgver}/T3-Code-x86_64.AppImage" + "$_appimage::https://github.com/pingdotgg/t3code/releases/download/v${pkgver}/$_asset" "${pkgname}-${pkgver}-LICENSE::https://raw.githubusercontent.com/pingdotgg/t3code/v${pkgver}/LICENSE" ) sha256sums=( diff --git a/packaging/aur/t3code-nightly-bin/PKGBUILD b/packaging/aur/t3code-nightly-bin/PKGBUILD index 22a7fa9287c10..69839d2661565 100644 --- a/packaging/aur/t3code-nightly-bin/PKGBUILD +++ b/packaging/aur/t3code-nightly-bin/PKGBUILD @@ -45,8 +45,9 @@ options=('!debug' '!strip') _upstream_version="${pkgver/_nightly./-nightly.}" _appimage="T3-Code-${_upstream_version}-x86_64.AppImage" +_asset="$_appimage" source=( - "$_appimage::https://github.com/pingdotgg/t3code/releases/download/v${_upstream_version}/T3-Code-Nightly-x86_64.AppImage" + "$_appimage::https://github.com/pingdotgg/t3code/releases/download/v${_upstream_version}/$_asset" "${pkgname}-${pkgver}-LICENSE::https://raw.githubusercontent.com/pingdotgg/t3code/v${_upstream_version}/LICENSE" ) sha256sums=(