question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tasks (and TaskExecutions) are not === in the onDid(Start|End)Task callbacks.

See original GitHub issue
  • VSCode Version: 1.44.2
  • OS Version: macOS 10.5.4

Steps to Reproduce:

  1. Create a new extension using yo code.
  2. Add the following to the ‘activate’ function body:
	let disposable = vscode.commands.registerCommand('extension.helloWorld', async () => {
		let echoTask = new vscode.Task({type: "taskbug"}, vscode.TaskScope.Workspace, 'echo', 'taskbug', new vscode.ProcessExecution('/bin/echo', ['hello world']));

		const echoTaskExecution = await vscode.tasks.executeTask(echoTask);

		vscode.tasks.onDidStartTaskProcess(e => {
			if (e.execution === echoTaskExecution) {
				console.log(`Detected that my task started with pid ${e.processId}`);
			} else if (e.execution.task === echoTask) {
				console.log(`Detected that my task started with pid ${e.processId}`);
			}
		});

		vscode.tasks.onDidEndTaskProcess(e => {
			if (e.execution === echoTaskExecution) {
				console.log(`Detected that my task exited with exit code ${e.exitCode}`);
			} else if (e.execution.task === echoTask) {
				console.log(`Detected that my task exited with exit code ${e.exitCode}`);
			}
		});
	});
  1. Run debug the extension and run the ‘Hello World’ command.

If you break inside the onDidStartTaskProcess and onDidEndTaskProcess that comparison fail, which means its difficult to determine when the task starts or ends.

It’s worth noting that in VSCode 1.43 the above comparisons both work, but in 1.44 this is not working.

Does this issue occur when all extensions are disabled?: Yes

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
alexr00commented, Jun 11, 2020

Added an API test.

1reaction
badsyntaxcommented, Jun 10, 2020

Related to bug https://github.com/microsoft/vscode/issues/98080

I’ve also verified this change fixes that bug. Thanks 👍

@alexr00 can i ask why there are no tests for this change? it would be useful to add tests to prevent regressions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Assigning Tasks to Workers: Handling Assignment Callbacks
Learn how to handle Assignment Callbacks in TaskRouter, including parameters included in the HTTP POST request and ways to respond in your code....
Read more >
Received unregistered task of type KeyError('modules ...
I'm trying to execute chains of task with celery, this is my tasks: from config import celery_app from modules.transaction.models import ...
Read more >
Chaining tasks using continuation tasks | Microsoft Learn
Learn to chain task by using continuation tasks in .NET. A continuation task is an asynchronous task that's invoked by another task.
Read more >
module folktale/concurrency/task
In order to combine callbacks, a user has to write code specific to each place ... Because Tasks abstract computations, and not values,...
Read more >
Manage follow-up actions with the task list - IDEXX Neo
A task will not be created for an unmatched result. ... Use the Callbacks tab to create, view, and manage tasks to remind...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found