Attempt to fix download failure.#2931
Attempt to fix download failure.#2931sean-mcmanus merged 5 commits intomastermicrosoft/vscode-cpptools:masterfrom seanmcm/fixProxySupportmicrosoft/vscode-cpptools:seanmcm/fixProxySupportCopy head branch name to clipboard
Conversation
|
There's not much point in pushing this change for Insiders, because the affected users won't be able to auto-install the fix. The VS Code people are saying they think it's a bug with their stuff, but they're not able to repro it. When we release our Insiders, we should be able to see how many download success versus failures we get in telemetry. |
| // instead of returning early from this function scope | ||
| let config: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration(); | ||
| let originalProxySupport: string = config.inspect<string>('http.proxySupport').globalValue; | ||
| while (true) { // Might need to try again with a different http.proxySupport setting. |
There was a problem hiding this comment.
I don't believe this can infinite loop...I could add some extra checks in case though.
|
This change shouldn't be noticeable until a 0.21.0-insiders3 or 0.22.0-insiders. |
| while (true) { // Might need to try again with a different http.proxySupport setting. | ||
| try { | ||
| await util.downloadFileToDestination(buildInfo.downloadUrl, vsixPath) | ||
| .catch(() => { throw new Error('Failed to download VSIX package'); }); |
There was a problem hiding this comment.
Why are you catching the promise and throwing a new error just to catch it in the try catch block?
You can remove the .catch(() => { throw new Error('') }); and create the error object in the catch block on line 336.
There was a problem hiding this comment.
Okay, I was just following the pattern used by the existing code. I'll try changing it.
| .catch(() => { throw new Error('Failed to download VSIX package'); }); | ||
| await installVsix(vsixPath, updateChannel) | ||
| .catch((error: Error) => { throw error; }); | ||
| .catch((error: Error) => { throw error; }); |
This explains why we have 1000 users with "Failed to download VSIX" results.
The current users of VS Code Insiders won't be able to auto-upgrade to 0.21.0-insiders until they get this fix in the non-Insiders release.