diff --git a/CHANGELOG.md b/CHANGELOG.md index 90df75b6..8869f094 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - Remove agent singleton so that client TLS certificates are reloaded on every API request. - Use Axios client to receive event stream so TLS settings are properly applied. - Set `usage-app=vscode` on `coder ssh` to fix deployment session counting. +- Fix version comparison logic for checking wildcard support in "coder ssh" ## [v1.4.1](https://github.com/coder/vscode-coder/releases/tag/v1.4.1) (2025-02-19) diff --git a/src/featureSet.test.ts b/src/featureSet.test.ts index 4fa594ce..feff09d6 100644 --- a/src/featureSet.test.ts +++ b/src/featureSet.test.ts @@ -11,4 +11,12 @@ describe("check version support", () => { expect(featureSetForVersion(semver.parse(v)).proxyLogDirectory).toBeTruthy() }) }) + it("wildcard ssh", () => { + ;["v1.3.3+e491217", "v2.3.3+e491217"].forEach((v: string) => { + expect(featureSetForVersion(semver.parse(v)).wildcardSSH).toBeFalsy() + }) + ;["v2.19.0", "v2.19.1", "v2.20.0+e491217", "v5.0.4+e491217"].forEach((v: string) => { + expect(featureSetForVersion(semver.parse(v)).wildcardSSH).toBeTruthy() + }) + }) }) diff --git a/src/featureSet.ts b/src/featureSet.ts index 6d1195a6..892c66ef 100644 --- a/src/featureSet.ts +++ b/src/featureSet.ts @@ -22,6 +22,6 @@ export function featureSetForVersion(version: semver.SemVer | null): FeatureSet // If this check didn't exist, VS Code connections would fail on // older versions because of an unknown CLI argument. proxyLogDirectory: (version?.compare("2.3.3") || 0) > 0 || version?.prerelease[0] === "devel", - wildcardSSH: (version?.compare("2.19.0") || 0) > 0 || version?.prerelease[0] === "devel", + wildcardSSH: (version ? version.compare("2.19.0") : -1) >= 0 || version?.prerelease[0] === "devel", } }