Skip to content

Conversation

@jherkel
Copy link
Contributor

@jherkel jherkel commented Sep 19, 2025

see issue #3878

With this patch user can delete selected ssh connection.

ssh_delete_button

@mbien mbien linked an issue Sep 19, 2025 that may be closed by this pull request
2 tasks
@mbien
Copy link
Member

mbien commented Sep 19, 2025

hmm. the dlight tests aren't hooked into CI. Most seem to work still. The solaris test needs to be turned off on linux and ConnectionManagerTest doesn't work out of the box for me. (probably something we should do before integrating this PR)

@mbien mbien added the UI User Interface label Sep 20, 2025
@jherkel
Copy link
Contributor Author

jherkel commented Sep 21, 2025

I was able to execute tests. I copied two test files (cndtestrc and testuserinfo) to $HOME and I used test VM (Fedora 42 with test account) and all tests were executed without failures, except Solaris as you mentioned above. There was a problem with java.lang.NoClassDefFoundError: java/security/acl/NotOwnerException. But if I understand correctly this class was removed in JDK 14. So maybe this test is obsolete (maybe must be refactored)?

@mbien
Copy link
Member

mbien commented Sep 22, 2025

regarding CI/tests: opened #8853

@mbien mbien added this to the NB28 milestone Sep 23, 2025
Copy link
Contributor

@matthiasblaesing matthiasblaesing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general this looks fine to me. However there is one failure situation:

  1. Establish a connection to demouser@demohost (use values of your choosing, for which you can establish a connection)
  2. Delete this new connection from the recent list
  3. Establish another connection to demouser@demohost

After step 2 I would expect the connection not to be in the recently used list, which is the case, but after step 3 I would expect it to be added again. That is not the case.

From looking through the code, I think the problem is, that no "new" connection is established. I.e. in step 1 an SSH connection to demouser@demohost is established. When that connection is established, the recently used list is updated. In step 3 no new connection is opened, but the terminal connection is multiplexed over the existing SSH connection. So no connection is opened.

Debugging let me here:

https://github.com/jherkel/netbeans/blob/d3dbb708288b88975fb3f60928a9aa8b4139a7e9/ide/dlight.nativeexecution/src/org/netbeans/modules/nativeexecution/api/util/ConnectionManager.java#L405-L413

where in step 3 I hit the return in line 412. I think this would need to be adjusted.

@jherkel
Copy link
Contributor Author

jherkel commented Sep 24, 2025

@matthiasblaesing I fixed this problem. I used a disconnect method as it seems like the most direct path to solve it. But because of that all existing terminal tabs for this connection will be closed. But I think if someone wants to delete a connection this is an acceptable behaviour.

@matthiasblaesing
Copy link
Contributor

@jherkel I have a counter suggestion: Shouldn't moving the updateRecentConnectionsList call into connectTo before the early return if it is already connected solve the problem without introducing potentially problematic/unwanted side effects?

While closing connection on deletion might be acceptable, the two actions don't need to be connected. Referring to my example from the sql editor: removing an entry from SQL history does not erase it from the point where it was inserted from history.

fix problem when connection isn't saved in a list of recent connections
@jherkel
Copy link
Contributor Author

jherkel commented Sep 26, 2025

@matthiasblaesing I refactored it. But connectTo isn't called if a connection exists, only isConnected is called by TerminalSupportImpl. So I added a new addConnectionToRecentConnections method.

@matthiasblaesing matthiasblaesing changed the title [NETBEANS-3878] add delete buton for the SSH Connection Dialog [NETBEANS-3878] Add delete buton for the SSH Connection Dialog Sep 29, 2025
Copy link
Contributor

@matthiasblaesing matthiasblaesing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@matthiasblaesing matthiasblaesing merged commit 349228c into apache:master Sep 29, 2025
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

UI User Interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

netbeans terminal window: unable to delete known servers list

3 participants