Skip to content

Commit f0740e8

Browse files
Fix version comparison logic for checking wildcard support in "coder ssh" (#446)
Co-authored-by: Benjamin <[email protected]>
1 parent 4a0f23d commit f0740e8

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- Remove agent singleton so that client TLS certificates are reloaded on every API request.
88
- Use Axios client to receive event stream so TLS settings are properly applied.
99
- Set `usage-app=vscode` on `coder ssh` to fix deployment session counting.
10+
- Fix version comparison logic for checking wildcard support in "coder ssh"
1011

1112
## [v1.4.1](https://github.com/coder/vscode-coder/releases/tag/v1.4.1) (2025-02-19)
1213

src/featureSet.test.ts

+8
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,12 @@ describe("check version support", () => {
1111
expect(featureSetForVersion(semver.parse(v)).proxyLogDirectory).toBeTruthy()
1212
})
1313
})
14+
it("wildcard ssh", () => {
15+
;["v1.3.3+e491217", "v2.3.3+e491217"].forEach((v: string) => {
16+
expect(featureSetForVersion(semver.parse(v)).wildcardSSH).toBeFalsy()
17+
})
18+
;["v2.19.0", "v2.19.1", "v2.20.0+e491217", "v5.0.4+e491217"].forEach((v: string) => {
19+
expect(featureSetForVersion(semver.parse(v)).wildcardSSH).toBeTruthy()
20+
})
21+
})
1422
})

src/featureSet.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ export function featureSetForVersion(version: semver.SemVer | null): FeatureSet
2222
// If this check didn't exist, VS Code connections would fail on
2323
// older versions because of an unknown CLI argument.
2424
proxyLogDirectory: (version?.compare("2.3.3") || 0) > 0 || version?.prerelease[0] === "devel",
25-
wildcardSSH: (version?.compare("2.19.0") || 0) > 0 || version?.prerelease[0] === "devel",
25+
wildcardSSH: (version ? version.compare("2.19.0") : -1) >= 0 || version?.prerelease[0] === "devel",
2626
}
2727
}

0 commit comments

Comments
 (0)