Skip to content

Commit 205f638

Browse files
authored
Fix Per Request Cancellation Tokens
While working on microsoft/vscode#22437, I believe there is a bug in the per request cancellation in the `setRequest` function on the line `currentRequestId = currentRequestId ;` This causes `currentRequestId` to always be undefined Fix is to assign the `currentRequestId` to `requestId`
1 parent 6117ed7 commit 205f638

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/server/cancellationToken/cancellationToken.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function createCancellationToken(args: string[]): ServerCancellationToken {
4848
return {
4949
isCancellationRequested: () => perRequestPipeName !== undefined && pipeExists(perRequestPipeName),
5050
setRequest(requestId: number) {
51-
currentRequestId = currentRequestId;
51+
currentRequestId = requestId;
5252
perRequestPipeName = namePrefix + requestId;
5353
},
5454
resetRequest(requestId: number) {
@@ -67,4 +67,4 @@ function createCancellationToken(args: string[]): ServerCancellationToken {
6767
};
6868
}
6969
}
70-
export = createCancellationToken;
70+
export = createCancellationToken;

0 commit comments

Comments
 (0)