From 2b6ac193411662c8d88179c1dfd93ee565e74de7 Mon Sep 17 00:00:00 2001 From: Mnigos Date: Wed, 7 Oct 2026 18:37:40 +0200 Subject: [PATCH] fix(desktop): the SnapShot GNOME extension loads on GNOME 51 The bundled snap-shot@t3.codes extension listed GNOME Shell 45-50 only, so GNOME 51 marked it OUT OF DATE and the desktop setup check reported the session as unsupported. Add "51" to shell-version and bump the metadata version from 2 to 3. The setup check only offers an update when the bundled version is higher than the installed one, so without the bump existing version-2 installs would never be replaced. The extension's D-Bus protocol Version stays at 2; it is a separate number and the app only accepts protocol versions 1 and 2. Tests move the installed fixtures to version 3, use GNOME 52 as the unsupported example, and cover a version-2 install on GNOME 51 reporting update-required. --- apps/desktop/gnome-extension/metadata.json | 4 ++-- .../src/snapShot/GnomeCaptureSetup.test.ts | 19 ++++++++++--------- .../src/snapShot/LinuxSnapShot.dbus.test.ts | 2 +- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/apps/desktop/gnome-extension/metadata.json b/apps/desktop/gnome-extension/metadata.json index ff51dbb9a486..ce9d435c593d 100644 --- a/apps/desktop/gnome-extension/metadata.json +++ b/apps/desktop/gnome-extension/metadata.json @@ -2,7 +2,7 @@ "uuid": "snap-shot@t3.codes", "name": "T3 Code SnapShots", "description": "Allows T3 Code to capture the focused window, identify it for optional accessibility text, and animate it into T3 Code. Disable this extension to revoke access.", - "shell-version": ["45", "46", "47", "48", "49", "50"], - "version": 2, + "shell-version": ["45", "46", "47", "48", "49", "50", "51"], + "version": 3, "url": "https://github.com/pingdotgg/t3code" } diff --git a/apps/desktop/src/snapShot/GnomeCaptureSetup.test.ts b/apps/desktop/src/snapShot/GnomeCaptureSetup.test.ts index 0c89f332171d..af2052c6a03a 100644 --- a/apps/desktop/src/snapShot/GnomeCaptureSetup.test.ts +++ b/apps/desktop/src/snapShot/GnomeCaptureSetup.test.ts @@ -118,12 +118,13 @@ it("refuses to replace symlinks or downgrade a newer extension", async () => { it.each([ [{}, "not-installed"], - [{ state: 2, version: 2 }, "disabled"], - [{ state: 1, version: 2 }, "enabled"], + [{ state: 2, version: 3 }, "disabled"], + [{ state: 1, version: 3 }, "enabled"], [{ state: 1, version: 1 }, "update-required"], - [{ state: 2, version: 2, enabled: false }, "extensions-disabled"], - [{ state: 3, version: 2, error: "Load failed" }, "error"], - [{ shell: "51.0" }, "unsupported"], + [{ state: 1, version: 2, shell: "51.0" }, "update-required"], + [{ state: 2, version: 3, enabled: false }, "extensions-disabled"], + [{ state: 3, version: 3, error: "Load failed" }, "error"], + [{ shell: "52.0" }, "unsupported"], ] as const)("reports GNOME setup state %j", async (options, status) => { const { setup, call } = fixture(options); expect((await setup.state()).status).toBe(status); @@ -141,7 +142,7 @@ it("requires login for local installs and updates until the new version is loade expect((await setup.state()).status).toBe("restart-required"); setup.close(); } - const { setup } = fixture({ state: 2, version: 2 }); + const { setup } = fixture({ state: 2, version: 3 }); expect((await setup.state()).status).toBe("disabled"); setup.close(); }); @@ -157,7 +158,7 @@ it("installs only on explicit action without invoking remote installation", asyn }); it("enables and disables only the capture UUID", async () => { - const { setup, call } = fixture({ state: 2, version: 2 }); + const { setup, call } = fixture({ state: 2, version: 3 }); await setup.perform("enable-extension"); await setup.perform("disable-extension"); for (const member of ["EnableExtension", "DisableExtension"]) { @@ -172,14 +173,14 @@ it("enables and disables only the capture UUID", async () => { }); it("never changes the global user-extensions preference", async () => { - const { setup, call } = fixture({ state: 2, version: 2, enabled: false }); + const { setup, call } = fixture({ state: 2, version: 3, enabled: false }); await expect(setup.perform("enable-extension")).rejects.toThrow("GNOME has disabled"); expect(call.mock.calls.every(([message]) => message.member.startsWith("Get"))).toBe(true); setup.close(); }); it("surfaces desktop rejection and disconnect as actionable failures", async () => { - const { setup, bus } = fixture({ state: 2, version: 2, accepted: false }); + const { setup, bus } = fixture({ state: 2, version: 3, accepted: false }); await expect(setup.perform("enable-extension")).rejects.toThrow("Sign out"); bus.emit("error", new Error("Session bus disconnected")); expect(await setup.state()).toEqual({ status: "error", message: "Session bus disconnected" }); diff --git a/apps/desktop/src/snapShot/LinuxSnapShot.dbus.test.ts b/apps/desktop/src/snapShot/LinuxSnapShot.dbus.test.ts index dca715a4a8af..7152fb406bac 100644 --- a/apps/desktop/src/snapShot/LinuxSnapShot.dbus.test.ts +++ b/apps/desktop/src/snapShot/LinuxSnapShot.dbus.test.ts @@ -94,7 +94,7 @@ it.runIf(hasDbus)("captures through real D-Bus marshalling on a private bus", as } else if (message.member === "GetExtensionInfo") { server!.send( Message.newMethodReturn(message, "a{sv}", [ - { state: new Variant("d", shellExtensionState), version: new Variant("d", 2) }, + { state: new Variant("d", shellExtensionState), version: new Variant("d", 3) }, ]), ); } else if (message.member === "EnableExtension" || message.member === "DisableExtension") {