dotnet / vscode-dotnet-runtime

VSCode Extension for Installing .NET via VS Code
MIT License
138 stars 256 forks source link

Handle No Connection Errors Better #1854

Closed nagilson closed 3 months ago

nagilson commented 3 months ago

In respone to the issue where we never timeout if there is no internet connection at https://github.com/microsoft/vscode-dotnettools/issues/1028

Axios (web request library we use) has a bug with no connection timeouts. Its timeout handler only works with request timeouts, not no connection timeouts. More at https://stackoverflow.com/questions/36690451/timeout-feature-in-the-axios-library-is-not-working. So yeah, it's going to be stuck forever waiting for a connection. I fixed #2 in the past by adding a custom timeout with a cancellation token. dotnet/vscode-dotnet-runtime@ced82f3#diff-ad11027eb5a8406f68425da0e49b1c8a4aa83394444043e247c10e7bb1976999

It looks like I got rid of that because I forgot about the axios timeout issue. dotnet/vscode-dotnet-runtime@3b1c251

This was initially in 1.8.1 and the failure rate improved a lot with 2.0.0 but that had a huge amount of code change. We need to inspect this change and QA it to make sure it doesnt make things worse. This will be the only change for 2.0.8 because of this.

This code used to be in the codebase for several versions so we have some degree of confidence in it.

nagilson commented 3 months ago

I think I've done enough QA on this to see that it works as expected.

It now times out properly where it did not do so before following the steps in the linked issue.

nagilson commented 3 months ago

https://github.com/dotnet/vscode-dotnet-runtime/issues/1858 is related and will be the complete fix for the user problem.

richlander commented 3 months ago

I get "No connection" a lot (on preview builds). I can share logs or test builds if that would be helpful. I am on Apple M1.