Skip to content

Conversation

@vbs-0
Copy link

@vbs-0 vbs-0 commented May 13, 2025

What

  • Implements robust WebSocket reconnection logic in the frontend terminal context.
  • Fixes issue where the terminal would stop updating after a disconnect, requiring a page refresh.

Why

  • Ensures the terminal automatically recovers from WebSocket disconnects.
  • Improves user experience and reliability for long-running terminal sessions.

How

  • Adds exponential backoff with jitter for reconnection attempts.
  • Limits reconnection attempts to prevent infinite loops.
  • Ensures only one socket is created and managed at a time.
  • Cleans up all timeouts and sockets on unmount or reconnection.
  • Uses consistent backend URL logic.
  • Removes duplicate/legacy connection logic and event handler registration.
  • All new logic is properly attributed to vbs_0.

Changelog

  • Terminal now automatically recovers from WebSocket disconnects.
  • No more manual page refresh required after network interruptions.

Checklist:


Closes #8447 (#8447)

@vbs-0 vbs-0 requested review from amanape and rbren as code owners May 13, 2025 09:44
Copy link
Collaborator

@amanape amanape left a comment

Choose a reason for hiding this comment

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

I'll try to test this soon, but I don't think this is the best solution to fix terminal issues

}

/**
* @author vbs_0
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please limit comments to information that helps with code clarity and/or functionality, authorship is already tracked via version control.

Copy link
Author

Choose a reason for hiding this comment

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

ok sir as it was my first pull request i got little excited

@tofarr
Copy link
Collaborator

tofarr commented May 18, 2025

Interesting approach - I was under the impression that the socketio library handled reconnection automatically? The disconnect event is often explicit - like when a user has too many conversations open, and reconnection would not be desirable.

@github-actions
Copy link
Contributor

This PR is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale Inactive for 40 days label Jun 18, 2025
@github-actions
Copy link
Contributor

This PR was closed because it has been stalled for over 30 days with no activity.

@github-actions github-actions bot closed this Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Stale Inactive for 40 days

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: terminal no longer updates without page refresh

3 participants