fix: propagate SSH authentication errors to the UI#1169
Closed
eduardomozart wants to merge 9 commits intognmyt:mainfrom
Closed
fix: propagate SSH authentication errors to the UI#1169eduardomozart wants to merge 9 commits intognmyt:mainfrom
eduardomozart wants to merge 9 commits intognmyt:mainfrom
Conversation
added 8 commits
February 24, 2026 10:58
Replace the dedicated SESSION_ERROR state channel with the existing CONNECTIONS stream. server/controllers/serverSession.js now broadcasts connection failures on CONNECTIONS (including a sessionError object with sessionId and message). client/src/common/hooks/useStateStream.js removes STATE_TYPES.SESSION_ERROR. client/src/common/contexts/SessionContext.jsx now listens to STATE_TYPES.CONNECTIONS, looks for data.sessionError, shows the error toast, and cleans up active sessions/activeSessionId using the sessionId from that payload. This simplifies state channels and centralizes connection-related updates.
Server: await createConnectionForSession before broadcasting the new session; on failure remove the session and return a 400-style error payload instead of broadcasting a CONNECTIONS error message. This ensures the frontend only sees sessions that successfully connected. Client: remove the StateStream CONNECTIONS error handler and related toast logic from SessionContext, since connection failures are now reported via the API response and handled by the API client/UI. Reduces transient/falsy UI state and centralizes error reporting.
|
Collaborator
|
May be a duplicate of #1053, which covers all connections not just SSH. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



📋 Description
This PR fixes an issue where users receive no visual feedback when an SSH connection fails due to authentication issues. While the backend correctly logs the failure, the error was not being properly bubbled up or handled by the frontend, resulting in a silent failure state.
When the
ssh2library emits an authentication failure, the error is caught incontrollers/serverSession.js, but the response is either not sent or is sent in a format the UI doesn't recognize as a displayable error.Fix
server/controllers/serverSession.jsto ensure that when a connection failure occurs, a proper error response (e.g.,500or401) is returned with a descriptive message.How To Test
🚀 Changes made to ...
✅ Checklist
🔗 Related Issues
Closes #1168