webSocketStartup logs "theWsServer.listen is not a function" — redundant .listen() call after constructor already starts the server
まだ誰も着手していません。
評価
- 難易度
- 1/5
- 見積もり時間
- 1時間未満
- 初心者へのやさしさ
- 85/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- javascript, node.js
- 領域
- backend, networking
調査の方向性
appserver.jsを開いてwebSocketStartupを見つけ、websocket.Serverの構築と、その後に続くstartup呼び出しを確認します。冗長なlisten呼び出しを削除し、startupでnot-a-functionメッセージがログに出力されなくなったことと、WebSocket接続が引き続き機能することを確認します。
索引モデルが issue の本文から書いたものです。
説明
When installing a test instance of rss.chat, Claude Code flagged an websockets error that turned out to not be an error. Here is Claude's bug report.
In appserver.js v0.8.3, the webSocketStartup function (rewritten 5/25/25) calls theWsServer.listen() after constructing the server with a port option:
theWsServer = new websocket.Server({port: config.websocketPort}); //5/25/25 by DW
theWsServer.on ("connection", handleWebSocketConnection); //5/25/25 by DW
console.log ("webSocketStartup: config.websocketPort == " + config.websocketPort);
theWsServer.listen (config.websocketPort); // ← throws
ws.Server has never exposed a public .listen() method. When you pass port to the constructor, the library creates an internal net.Server and calls .listen() on it automatically — the socket is already bound and ready before that last line runs. The call throws, the catch logs "webSocketStartup: err.message == theWsServer.listen is not a function", and the function returns.
The server is not broken — port binding and the connection handler are both set up before the throw, so WebSocket connections work normally. But the logged message looks like a fatal startup failure and will alarm anyone reading the logs.
Fix: remove the redundant .listen() call.
function webSocketStartup () {
if (config.flWebsocketEnabled) {
try {
theWsServer = new websocket.Server({port: config.websocketPort});
theWsServer.on ("connection", handleWebSocketConnection);
console.log ("webSocketStartup: listening on port " + config.websocketPort);
}
catch (err) {
console.log ("webSocketStartup: err.message == " + err.message);
}
Environment: daveappserver 0.8.3, ws 8.21.1, Node v24.18.0.
- 主要言語
- JavaScript
- スター
- 7
- フォーク
- 3
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
似ている issue
-
code-quality refactoring
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
githubnext/gh-aw-cao#13143 ·
-
status: needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100