NodeSSH Reconnect Issue: isConnected() Returns TRUE Even When Connection Unsuccessful
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- node.js, typescript
- 領域
- networking
調査の方向性
TypeScript の connect メソッドから開始し、SSH2 の ready、error、end、close イベントに対して this.connection がいつ割り当てられるかを追跡します。失敗した reconnect の後に isConnected() が接続済みと報告しないことを確認して変更を検証します。issue では実行するファイルやテストは指定されていません。
索引モデルが issue の本文から書いたものです。
説明
I am encountering an issue which seems to be related to ISSUE-429, where the problem still persists. As im not aware of any pitfalls in the code, i have created a suggestion to resolve the issue.
Description:
The problem is caused by the assignment of the this.connection property before the connection promise resolves. Specifically, the this.connection property is being set before the connection.on('ready') event is triggered.
Proposed Solution:
To resolve this issue, I suggest moving the assignment of this.connection inside the connection.on('ready') event in the connect method:
public async connect(givenConfig: Config): Promise<this> {
// ... (Rest of the code remains the same)
const connection = new SSH2.Client();
await new Promise<void>((resolve, reject) => {
connection.on('error', reject);
if (config.onKeyboardInteractive) {
connection.on('keyboard-interactive', config.onKeyboardInteractive);
}
connection.on('ready', () => {
connection.removeListener('error', reject);
this.connection = connection; // Move this line inside the 'ready' event
resolve();
});
connection.on('end', () => {
if (this.connection === connection) {
this.connection = null;
}
});
connection.on('close', () => {
if (this.connection === connection) {
this.connection = null;
}
reject(new SSHError('No response from server', 'ETIMEDOUT'));
});
connection.connect(config);
});
return this;
}
Will i help?
Yeah, let us discuss and i can create a PR :)
- 主要言語
- TypeScript
- スター
- 1k
- フォーク
- 94
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
steelbrain/node-ssh のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
steelbrain/node-ssh#487 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
steelbrain/node-ssh#482 · コメント 3 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
steelbrain/node-ssh#474 · コメント 3 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
steelbrain/node-ssh#473 · コメント 1 件 · リアクション 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 20/100
steelbrain/node-ssh#472 ·
steelbrain/node-ssh の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
cli: `execCargoMetadata` decodes stdout per chunk, corrupting non-ASCII paths across pipe boundariesオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
lingdojo/kana-dojo#34127 · コメント 1 件 · リアクション 5 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
osmlab/name-suggestion-index#13104 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100