microsoft / microsoft/vscode-debugadapter-node
ProtocolClient.send breaks async stacktraces
Nessuno ha ancora preso questa issue.
- Lingua principale
- TypeScript
- Stelle
- 306
- Fork
- 90
- Merge medio
- 8h 36m
- PR unite (30g)
- 3
Descrizione
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.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia in testSupport/src/protocolClient.ts, nell’implementazione collegata di ProtocolClient.send, e verifica come chiama doSend. Segui il percorso della promise rifiutata e verifica che send attenda un wrapper intorno alla risposta grezza prima di tradurre l’errore. È completato quando le tracce dello stack dei rifiuti asincroni includono send e il suo chiamante.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript
- Ambito
- api
- Tipo di issue
- Bug
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 45/100