microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.05k stars 28.8k forks source link

Add an option to cancel a git pull/push request if it takes too long #210267

Open yassine-safraoui opened 5 months ago

yassine-safraoui commented 5 months ago

I'm uncertain whether this issue fits more as a bug or a feature request; it seems to it's more of a bug due to how annoying it is but anyways.

Context: Here is the context, at my French engineering school, we use a hosted version of GitLab on the school servers for school projects. Accessing the server requires connecting through the school's VPN. Therefore, I must ensure that the VPN is active before pulling/pushing changes.

Problem: The issue takes place when I forget to enable the VPN before initiating a push/pull operation in Visual Studio Code. In such cases, Visual Studio Code keeps trying to send the request persistently for 2 minutes or longer without providing an option to cancel. The only way to stop it is to restart Visual Studio Code, which gets very annoying especially when working on big projects with a lot of extensions enabled and on a not so powerful laptop. Ideally, there should be a configurable setting to define the duration Visual Studio Code retries a failed network request before prompting an error notification indicating the failure due to network issues.

Note that this issue isn't unique to my situation; it can also occur in scenarios where a user experiences Wi-Fi disruptions or any other network-related problems. I understand that it may be hard to implement the timeout, but at least add an option somewhere in the scm panel to cancel the current ongoing request, I suppose that should not be too complicated!

grgar commented 5 months ago

Enable git.supportCancellation? #59047

yassine-safraoui commented 5 months ago

I just tried it now, yes it does solve the problem if I clicked on the sync button, but if I try to pull/push, the toast menu that contains the cancel button doesn't show, so this only works for sync and not for push/pull