Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: remote ide no longer reconnects after plugin upgrade#167

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fioan89 merged 1 commit intomainfromfix-ide-connection-lost-after-upgrade
Aug 11, 2025
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletionsCHANGELOG.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,6 +11,10 @@
- URL validation is stricter in the connection screen and URI protocol handler
- support for verbose logging a sanitized version of the REST API request and responses

### Fixed

- remote IDE reconnects automatically after plugin upgrade

## 0.6.0 - 2025-07-25

### Changed
Expand Down
61 changes: 46 additions & 15 deletionssrc/main/kotlin/com/coder/toolbox/views/EnvironmentView.kt
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,20 +21,51 @@ class EnvironmentView(
private val workspace: Workspace,
private val agent: WorkspaceAgent,
) : SshEnvironmentContentsView {
override suspend fun getConnectionInfo(): SshConnectionInfo = object : SshConnectionInfo {
/**
* The host name generated by the cli manager for this workspace.
*/
override val host: String = cli.getHostname(url, workspace, agent)

/**
* The port is ignored by the Coder proxy command.
*/
override val port: Int = 22

/**
* The username is ignored by the Coder proxy command.
*/
override val userName: String? = null
override suspend fun getConnectionInfo(): SshConnectionInfo = WorkspaceSshConnectionInfo(url, cli, workspace, agent)
}

private class WorkspaceSshConnectionInfo(
url: URL,
cli: CoderCLIManager,
private val workspace: Workspace,
private val agent: WorkspaceAgent,
) : SshConnectionInfo {
/**
* The host name generated by the cli manager for this workspace.
*/
override val host: String = cli.getHostname(url, workspace, agent)

/**
* The port is ignored by the Coder proxy command.
*/
override val port: Int = 22

/**
* The username is ignored by the Coder proxy command.
*/
override val userName: String? = null

override fun equals(other: Any?): Boolean {
if (this === other) return true
if (javaClass != other?.javaClass) return false

other as WorkspaceSshConnectionInfo

if (port != other.port) return false
if (workspace.name != other.workspace.name) return false
if (agent.name != other.agent.name) return false
if (host != other.host) return false

return true
}

override fun hashCode(): Int {
var result = port
result = 31 * result + workspace.name.hashCode()
result = 31 * result + agent.name.hashCode()
result = 31 * result + host.hashCode()
return result
}


}
Loading

[8]ページ先頭

©2009-2025 Movatter.jp