xpack/vscode-xpack-extension-ts

Fix the concurrency issue caused by the package.json watcher

Closed this issue · 1 comments

The package.json watcher triggers refresh events for each new file created.

If the events come in quick sequence (like during xpm install, when new files are created), the data manager does not complete the tree creation, and the next event may come while the old tree is disposed.

A cancellation logic should be implemented, and the results of the cancelled jobs should be ignored.

The disposal should be done at the very end, to avoid interference with new tasks.

Fixed on 2021-04-23.