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

Commit6d509d6

Browse files
authored
fix: remote ide no longer reconnects after plugin upgrade (#167)
When the plugin is upgraded while JBClient is connected to a remote devserver via the Coder SSH proxy/tunnel, the upgrade process kills andre-establishes the SSH connection. However, JBClient/Toolbox fails todetect the restored connection and reports "Toolbox: Target environmentcom.coder.toolbox:bobiverse-bob.dev not found" error.While digging into the Toolbox bytecode—specifically`ClientOverSshTunnelConnector` — I realized the issue likely stems froman incorrect equals implementation in our custom SSH connection infoobject. In short, when a plugin upgrade terminates the SSH tunnel, theconnector’s monitoring logic correctly detects the lost connection andwaits. But when the SSH connection is re-established, the monitoringlogic fails to recognize it as a valid replacement, because equals isstill using the default `Object#equals` rather than a proper value-basedimplementation.Unfortunately, I wasn’t able to properly test this—specifically,upgrading from a version without the fix to one that includes it—becauseall Toolbox marketplace feeds are signed, preventing us from using atool like mitmproxy to serve a locally modified plugin version. Giventhat, I propose releasing the change first and then performing theupgrade test to confirm the fix.-resolves#61
1 parent5af07af commit6d509d6

File tree

2 files changed

+50
-15
lines changed

2 files changed

+50
-15
lines changed

‎CHANGELOG.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
- URL validation is stricter in the connection screen and URI protocol handler
1212
- support for verbose logging a sanitized version of the REST API request and responses
1313

14+
###Fixed
15+
16+
- remote IDE reconnects automatically after plugin upgrade
17+
1418
##0.6.0 - 2025-07-25
1519

1620
###Changed

‎src/main/kotlin/com/coder/toolbox/views/EnvironmentView.kt‎

Lines changed: 46 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,51 @@ class EnvironmentView(
2121
privatevalworkspace:Workspace,
2222
privatevalagent:WorkspaceAgent,
2323
) : SshEnvironmentContentsView {
24-
overridesuspendfungetConnectionInfo():SshConnectionInfo=object:SshConnectionInfo {
25-
/**
26-
* The host name generated by the cli manager for this workspace.
27-
*/
28-
overrideval host:String= cli.getHostname(url, workspace, agent)
29-
30-
/**
31-
* The port is ignored by the Coder proxy command.
32-
*/
33-
overrideval port:Int=22
34-
35-
/**
36-
* The username is ignored by the Coder proxy command.
37-
*/
38-
overrideval userName:String?=null
24+
overridesuspendfungetConnectionInfo():SshConnectionInfo=WorkspaceSshConnectionInfo(url, cli, workspace, agent)
25+
}
26+
27+
privateclassWorkspaceSshConnectionInfo(
28+
url:URL,
29+
cli:CoderCLIManager,
30+
privatevalworkspace:Workspace,
31+
privatevalagent:WorkspaceAgent,
32+
) : SshConnectionInfo {
33+
/**
34+
* The host name generated by the cli manager for this workspace.
35+
*/
36+
overrideval host:String= cli.getHostname(url, workspace, agent)
37+
38+
/**
39+
* The port is ignored by the Coder proxy command.
40+
*/
41+
overrideval port:Int=22
42+
43+
/**
44+
* The username is ignored by the Coder proxy command.
45+
*/
46+
overrideval userName:String?=null
47+
48+
overridefunequals(other:Any?):Boolean {
49+
if (this=== other)returntrue
50+
if (javaClass!= other?.javaClass)returnfalse
51+
52+
otherasWorkspaceSshConnectionInfo
53+
54+
if (port!= other.port)returnfalse
55+
if (workspace.name!= other.workspace.name)returnfalse
56+
if (agent.name!= other.agent.name)returnfalse
57+
if (host!= other.host)returnfalse
58+
59+
returntrue
60+
}
61+
62+
overridefunhashCode():Int {
63+
var result= port
64+
result=31* result+ workspace.name.hashCode()
65+
result=31* result+ agent.name.hashCode()
66+
result=31* result+ host.hashCode()
67+
return result
3968
}
69+
70+
4071
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp