From e33aa8c8c6e834093d63e4bab05c9e980478ed5b Mon Sep 17 00:00:00 2001 From: Garrett Delfosse Date: Fri, 25 Oct 2024 15:15:42 -0400 Subject: [PATCH] fix: use background ssh channel for link handler After some investigation into the interaction with the Jetbrains plugin and coder/coder I found a bug where 2 ssh sessions labeled with `jetbrains` for the usage app were being open. We only want to use the main hostname when we want to track user activity, so for any background processes we should be using the background hostname. --- src/main/kotlin/com/coder/gateway/util/LinkHandler.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/com/coder/gateway/util/LinkHandler.kt b/src/main/kotlin/com/coder/gateway/util/LinkHandler.kt index 22c0e3b3..bbf9744f 100644 --- a/src/main/kotlin/com/coder/gateway/util/LinkHandler.kt +++ b/src/main/kotlin/com/coder/gateway/util/LinkHandler.kt @@ -127,7 +127,7 @@ open class LinkHandler( verifyDownloadLink(parameters) WorkspaceProjectIDE.fromInputs( name = CoderCLIManager.getWorkspaceParts(workspace, agent), - hostname = CoderCLIManager.getHostName(deploymentURL.toURL(), workspace, client.me, agent), + hostname = CoderCLIManager.getBackgroundHostName(deploymentURL.toURL(), workspace, client.me, agent), projectPath = parameters.folder(), ideProductCode = parameters.ideProductCode(), ideBuildNumber = parameters.ideBuildNumber(),