New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debt: avoid promise.cancel in zip.ts #56656
Conversation
const throttler = new SimpleThrottler(); | ||
return createCancelablePromise(token => { | ||
|
||
once(token.onCancellationRequested)(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No once
not needed as the event will only ever fire once
} | ||
|
||
if (!options.sourcePathRegex.test(entry.fileName)) { | ||
readNextEntry(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we not passing the real token instead of none token?
src/vs/base/node/zip.ts
Outdated
} | ||
|
||
if (!options.sourcePathRegex.test(entry.fileName)) { | ||
readNextEntry(CancellationToken.None); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we not passing the real token instead of none token?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, I guess I added this first and only later added the token.
@sandy081 can you check again, I also removed |
LGTM |
For #56137
@sandy081 adding you because this area is sensitive for extracting extensions. I converted the code to use
CancellationToken
and avoidTPromise.cancel()
./cc @jrieken