Skip to content

Conversation

@jrobinso
Copy link
Contributor

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces WebSocket support to igv.js, enabling bidirectional communication between a WebSocket server and browser instances. The implementation includes a client that connects to a server with exponential backoff retry logic, a test server for development, and a message handler that exposes a subset of the igv.js API through JSON-formatted commands.

  • Added WebSocket client with automatic reconnection functionality
  • Implemented message handler supporting various IGV operations (navigation, track management, session control)
  • Created test server infrastructure with interactive command interface
  • Version bumped from 3.6.0 to 3.7.0

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
test/websocket/igvWebSocketServer.js New WebSocket test server with client connection management and interactive command interface
js/websocket/websocketClient.js New WebSocket client with reconnection logic and message handling
js/websocket/messageHandler.js New message handler implementing IGV API commands via WebSocket
package.json Added ws dependency (^8.18.3) and version bump to 3.7.0
js/version.js Updated version constant to 3.7.0
js/index.js Exported createWebSocketClient function
js/igv-create.js Integrated WebSocket client initialization based on config
dev/misc/ws.html New test page demonstrating WebSocket configuration
Comments suppressed due to low confidence (1)

js/websocket/messageHandler.js:62

                        returnMsg.message = `Removed track(s) ${color} for ${tracks.length} track(s)`

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 46 to 48
if("close" === json.type) {
// TODO -- close without starting the retry interval
}
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

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

The condition "close" === json.type is checked but the TODO comment indicates no action is taken. This creates dead code that checks a condition but does nothing, making the code confusing. Either implement the close logic or remove this check.

Copilot uses AI. Check for mistakes.

if (this.wss.clients.size === 0) {
resolve({
message:"No client connection. Is IGV-Web running?",
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

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

Double space after period should be a single space for consistency.

Copilot uses AI. Check for mistakes.
@jrobinso jrobinso merged commit dadb30d into master Dec 17, 2025
2 checks passed
@jrobinso jrobinso deleted the websockets branch December 17, 2025 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants