Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e7acd53

Browse files
committed
fix: install the build number if available
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 e7acd53

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
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

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)