-
Notifications
You must be signed in to change notification settings - Fork 242
Websockets #2059
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Websockets #2059
Conversation
There was a problem hiding this 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
- Variable 'color' is used before its declaration.
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.
| if("close" === json.type) { | ||
| // TODO -- close without starting the retry interval | ||
| } |
Copilot
AI
Dec 17, 2025
There was a problem hiding this comment.
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.
|
|
||
| if (this.wss.clients.size === 0) { | ||
| resolve({ | ||
| message:"No client connection. Is IGV-Web running?", |
Copilot
AI
Dec 17, 2025
There was a problem hiding this comment.
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.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
No description provided.