Skip to content

Commit 8eb08e9

Browse files
authored
fix: install the build number if available (#131)
This PR fixes an issue with URI handling which was not installing the exact same version requested by the user if the version was available for install on the workspace.
1 parent 81d7c29 commit 8eb08e9

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- `Stop` action is now available for running workspaces that have an out of date template.
1313
- outdated and stopped workspaces are now updated and started when handling URI
1414
- show errors when the Toolbox is visible again after being minimized.
15+
- URI handling now installs the exact build number if it is available for the workspace.
1516

1617
## 0.3.0 - 2025-06-10
1718

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
version=0.3.0
1+
version=0.3.1
22
group=com.coder.toolbox
33
name=coder-toolbox

src/main/kotlin/com/coder/toolbox/util/CoderProtocolHandler.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,16 +380,16 @@ open class CoderProtocolHandler(
380380
return null
381381
}
382382

383-
val matchingBuildNumber = availableVersions.firstOrNull { it.contains(buildNumber) } != null
384-
if (!matchingBuildNumber) {
383+
val buildNumberIsNotAvailable = availableVersions.firstOrNull { it.contains(buildNumber) } == null
384+
if (buildNumberIsNotAvailable) {
385385
val selectedIde = availableVersions.maxOf { it }
386386
context.logAndShowInfo(
387387
"$productCode-$buildNumber not available",
388388
"$productCode-$buildNumber is not available, we've selected the latest $selectedIde"
389389
)
390390
return selectedIde
391391
}
392-
return null
392+
return "$productCode-$buildNumber"
393393
}
394394

395395
private fun installJBClient(selectedIde: String, environmentId: String): Job = context.cs.launch {

0 commit comments

Comments
 (0)