microsoft / microsoft/vscode-debugadapter-node

ProtocolClient.send breaks async stacktraces

オープン
#307 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

bug
主要言語
TypeScript
スター
306
フォーク
90
平均マージ
8時間 36分
マージ済み PR(30日)
3

説明

The following implementation:
https://github.com/microsoft/vscode-debugadapter-node/blob/1621133e71527d9d46438edb766eaf8e731b68f5/testSupport/src/protocolClient.ts#L69-L80
is not async itself and returns the promise immediately without awaiting it. Consequently, if the promise gets rejected with an error, the stack trace in the error does not include either send or its caller. This unnecessarily complicates debugging of e.g. async unit tests that await send() and receive an unexpected error response.

Instead, the callback for doSend should capture the raw response in a wrapper promise, and then send should await that promise and translate it to a throw.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

testSupport/src/protocolClient.ts のリンクされた ProtocolClient.send 実装から始め、どのように doSend を呼び出しているかを調べます。拒否された promise の経路を追跡し、エラーを変換する前に send が raw response をラップする wrapper を await していることを確認します。完了条件は、非同期の拒否時のスタックトレースに send とその呼び出し元が含まれることです。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
typescript
領域
api
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。