Bogus "Canceled" error message when stopped debugging in certain scenarios
- VSCode Version: 1.2.1
- OS Version: All
Steps to Reproduce:
- Start debugging with a debug adapter which won't send a response (e.g., there's a bug in the debug adapter, or the debug adapter is waiting for an external event (attaching a debugger to it)) for a request from VSCode.
- When stopping the debug session (
disconnectrequest), there is an error popping up in the VSCode UI that reads "Canceled".

Expected: debugging stops cleanly as far as the user can tell.
I spent a short amount of time looking into this to see if the error message was coming from the debug adapter somehow. I found that the disconnect request calls cancel() on all sent promises.
https://github.com/Microsoft/vscode/blob/c5429332d4ac326a94a6c5e87fffefcb14d10e84/src/vs/workbench/parts/debug/node/rawDebugSession.ts#L261
This is the exception that is causing the error in the VSCode UI https://github.com/Microsoft/vscode/blob/bfb5b806e4f0328102bde3fd8750e63c66c2f19a/src/vs/base/common/winjs.base.raw.js#L1654
It doesn't seem like the promises that are being pushed into sentPromises have an onCancel() handler
https://github.com/Microsoft/vscode/blob/81050abedbe54597b9506609eb5b7cb916ddc9c6/src/vs/workbench/parts/debug/node/v8Protocol.ts#L44
https://github.com/Microsoft/vscode/blob/bfb5b806e4f0328102bde3fd8750e63c66c2f19a/src/vs/base/common/winjs.base.d.ts#L64
@isidorn
@edumunoz thanks for the nice analysis.
I'm still seeing the issue with these steps:
- launch vscode-node-debug as a server
- set a breakpoint in
nextRequest - add the
debugServer: 4711to your launch config - start a node debug session
- press the step' button (breakpoint is hit in node-debug)
- press 'stop' button:

Will investigate - not critical, assigning to july
I'm writing a debug adapter and am getting this message in 1.3.1, is this something that will be patched, or possibly an error in my adapter code, my disconnect request only calls clearInterval(this._timer); super.disconnectRequest(response, args);. Everything works fine, I just get that error message, my code, or being patched?
This issue was assigned to July and that milestone has not been released yet. So it will be fixed in 1.4, or you can use our insiders release which already has the fix.