TypeScript
fix(desktop): the SnapShot GNOME extension loads on GNOME 51 (#17436)
Igor Makowskic32dc2f1c97e
diff --git a/apps/desktop/gnome-extension/metadata.json b/apps/desktop/gnome-extension/metadata.jsonindex ff51dbb9a48..ce9d435c593 100644--- a/apps/desktop/gnome-extension/metadata.json+++ b/apps/desktop/gnome-extension/metadata.json@@ -2,7 +2,7 @@"uuid": "[email protected]","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.tsindex 0c89f332171..af2052c6a03 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 loadeexpect((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.tsindex 2759f761e8f..1cb75134ad0 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") {