broadcastToSession in server/plugins/websocket.js (line 46) is exported but never imported or called anywhere in the codebase — not in any route handler, plugin, utility, test, or client-side composable. It's dead code that should be removed to reduce maintenance burden and prevent developers from building on a non-existent broadcasting mechanism.
Acceptance criteria
broadcastToSession is removed from server/plugins/websocket.js
Its three dependencies (getSessionConnections, addSessionConnection, removeSessionConnection) remain, since they are actively used within the plugin for connection tracking (lines 138, 141, 158)
No other file imports or references broadcastToSession
All existing tests pass
Problem
I inspected server/plugins/websocket.js and confirmed that broadcastToSession is defined at line 46 as an exported function. A full search across the repository (including all .js files, test files, and composables) shows zero callers — no import, no dynamic import(), no usage in routes or plugins. The connection-tracking helpers it depends on (getSessionConnections, addSessionConnection, removeSessionConnection) are still actively used within the WebSocket plugin itself for per-session connection management, but the broadcast function that consumes those helpers is never invoked.
This dead code creates two risks:
Developers may assume there's a working broadcast mechanism and build features on top of it.
The exported API surface grows without corresponding test coverage or usage, increasing the cost of future refactoring.
Proposed work
Delete broadcastToSession (lines 46–53) from server/plugins/websocket.js.
Keep getSessionConnections, addSessionConnection, and removeSessionConnection — they are used internally at lines 138, 141, and 158.
## Summary
`broadcastToSession` in `server/plugins/websocket.js` (line 46) is exported but never imported or called anywhere in the codebase — not in any route handler, plugin, utility, test, or client-side composable. It's dead code that should be removed to reduce maintenance burden and prevent developers from building on a non-existent broadcasting mechanism.
## Acceptance criteria
- `broadcastToSession` is removed from `server/plugins/websocket.js`
- Its three dependencies (`getSessionConnections`, `addSessionConnection`, `removeSessionConnection`) remain, since they are actively used within the plugin for connection tracking (lines 138, 141, 158)
- No other file imports or references `broadcastToSession`
- All existing tests pass
## Problem
I inspected `server/plugins/websocket.js` and confirmed that `broadcastToSession` is defined at line 46 as an exported function. A full search across the repository (including all `.js` files, test files, and composables) shows zero callers — no `import`, no dynamic `import()`, no usage in routes or plugins. The connection-tracking helpers it depends on (`getSessionConnections`, `addSessionConnection`, `removeSessionConnection`) are still actively used within the WebSocket plugin itself for per-session connection management, but the broadcast function that consumes those helpers is never invoked.
This dead code creates two risks:
1. Developers may assume there's a working broadcast mechanism and build features on top of it.
2. The exported API surface grows without corresponding test coverage or usage, increasing the cost of future refactoring.
## Proposed work
- Delete `broadcastToSession` (lines 46–53) from `server/plugins/websocket.js`.
- Keep `getSessionConnections`, `addSessionConnection`, and `removeSessionConnection` — they are used internally at lines 138, 141, and 158.
<!-- jasper-fp:2052804a32d2ecc2 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
broadcastToSessioninserver/plugins/websocket.js(line 46) is exported but never imported or called anywhere in the codebase — not in any route handler, plugin, utility, test, or client-side composable. It's dead code that should be removed to reduce maintenance burden and prevent developers from building on a non-existent broadcasting mechanism.Acceptance criteria
broadcastToSessionis removed fromserver/plugins/websocket.jsgetSessionConnections,addSessionConnection,removeSessionConnection) remain, since they are actively used within the plugin for connection tracking (lines 138, 141, 158)broadcastToSessionProblem
I inspected
server/plugins/websocket.jsand confirmed thatbroadcastToSessionis defined at line 46 as an exported function. A full search across the repository (including all.jsfiles, test files, and composables) shows zero callers — noimport, no dynamicimport(), no usage in routes or plugins. The connection-tracking helpers it depends on (getSessionConnections,addSessionConnection,removeSessionConnection) are still actively used within the WebSocket plugin itself for per-session connection management, but the broadcast function that consumes those helpers is never invoked.This dead code creates two risks:
Proposed work
broadcastToSession(lines 46–53) fromserver/plugins/websocket.js.getSessionConnections,addSessionConnection, andremoveSessionConnection— they are used internally at lines 138, 141, and 158.