Skip to content

Commit 2b6ac19

Browse files
committed
fix(desktop): the SnapShot GNOME extension loads on GNOME 51
The bundled [email protected] 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.
1 parent 521f5b5 commit 2b6ac19

3 files changed

Lines changed: 13 additions & 12 deletions

File tree

‎apps/desktop/gnome-extension/metadata.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"uuid": "[email protected]",
33
"name": "T3 Code SnapShots",
44
"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.",
5-
"shell-version": ["45", "46", "47", "48", "49", "50"],
6-
"version": 2,
5+
"shell-version": ["45", "46", "47", "48", "49", "50", "51"],
6+
"version": 3,
77
"url": "https://github.com/pingdotgg/t3code"
88
}

‎apps/desktop/src/snapShot/GnomeCaptureSetup.test.ts‎

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,13 @@ it("refuses to replace symlinks or downgrade a newer extension", async () => {
118118

119119
it.each([
120120
[{}, "not-installed"],
121-
[{ state: 2, version: 2 }, "disabled"],
122-
[{ state: 1, version: 2 }, "enabled"],
121+
[{ state: 2, version: 3 }, "disabled"],
122+
[{ state: 1, version: 3 }, "enabled"],
123123
[{ state: 1, version: 1 }, "update-required"],
124-
[{ state: 2, version: 2, enabled: false }, "extensions-disabled"],
125-
[{ state: 3, version: 2, error: "Load failed" }, "error"],
126-
[{ shell: "51.0" }, "unsupported"],
124+
[{ state: 1, version: 2, shell: "51.0" }, "update-required"],
125+
[{ state: 2, version: 3, enabled: false }, "extensions-disabled"],
126+
[{ state: 3, version: 3, error: "Load failed" }, "error"],
127+
[{ shell: "52.0" }, "unsupported"],
127128
] as const)("reports GNOME setup state %j", async (options, status) => {
128129
const { setup, call } = fixture(options);
129130
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
141142
expect((await setup.state()).status).toBe("restart-required");
142143
setup.close();
143144
}
144-
const { setup } = fixture({ state: 2, version: 2 });
145+
const { setup } = fixture({ state: 2, version: 3 });
145146
expect((await setup.state()).status).toBe("disabled");
146147
setup.close();
147148
});
@@ -157,7 +158,7 @@ it("installs only on explicit action without invoking remote installation", asyn
157158
});
158159

159160
it("enables and disables only the capture UUID", async () => {
160-
const { setup, call } = fixture({ state: 2, version: 2 });
161+
const { setup, call } = fixture({ state: 2, version: 3 });
161162
await setup.perform("enable-extension");
162163
await setup.perform("disable-extension");
163164
for (const member of ["EnableExtension", "DisableExtension"]) {
@@ -172,14 +173,14 @@ it("enables and disables only the capture UUID", async () => {
172173
});
173174

174175
it("never changes the global user-extensions preference", async () => {
175-
const { setup, call } = fixture({ state: 2, version: 2, enabled: false });
176+
const { setup, call } = fixture({ state: 2, version: 3, enabled: false });
176177
await expect(setup.perform("enable-extension")).rejects.toThrow("GNOME has disabled");
177178
expect(call.mock.calls.every(([message]) => message.member.startsWith("Get"))).toBe(true);
178179
setup.close();
179180
});
180181

181182
it("surfaces desktop rejection and disconnect as actionable failures", async () => {
182-
const { setup, bus } = fixture({ state: 2, version: 2, accepted: false });
183+
const { setup, bus } = fixture({ state: 2, version: 3, accepted: false });
183184
await expect(setup.perform("enable-extension")).rejects.toThrow("Sign out");
184185
bus.emit("error", new Error("Session bus disconnected"));
185186
expect(await setup.state()).toEqual({ status: "error", message: "Session bus disconnected" });

‎apps/desktop/src/snapShot/LinuxSnapShot.dbus.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ it.runIf(hasDbus)("captures through real D-Bus marshalling on a private bus", as
9494
} else if (message.member === "GetExtensionInfo") {
9595
server!.send(
9696
Message.newMethodReturn(message, "a{sv}", [
97-
{ state: new Variant("d", shellExtensionState), version: new Variant("d", 2) },
97+
{ state: new Variant("d", shellExtensionState), version: new Variant("d", 3) },
9898
]),
9999
);
100100
} else if (message.member === "EnableExtension" || message.member === "DisableExtension") {

0 commit comments

Comments
 (0)