Add ability to cancel "Listing Salesforce SFDX Connectios"

Issue #1542 resolved
Justin Julicher created an issue

Hi Scott

I’m having to forcibly close Webstorm a few times a day - mainly (as I work on a laptop) when I change network connections it will just hang. Can’t pinpoint exactly when or why but that seems to be a common factor. If I am working off network and on wifi hotspot it seems to be worse.

So I would like if I could cancel these processes rather than them hogging the whole interface either by backgrounding them or having the ability to cancel them.

Would it be possible to have the the metadata dialog open up and then show spinners on the connection drop down perhaps?

Examples:

In below screen shot add a cancel button.

Alternatively, as the connection info is in the [user home]/.sfdx/ directory could we have an option for you to parse the connections in there with the ability to switch to the sfdx cli if there are any issues? I would imaging you would be able to parse this directory a lot lot faster than the time it takes (for me usually 5-10 seconds). That’s why it was easy for me to grab the screenshot above.

thanks

Comments (3)

  1. Scott Wells repo owner

    Unfortunately it's not quite as simple as you'd think. However, there's another solution coming for this. I've been working with Thomas Dvornik at Salesforce on a much more efficient way to list the SFDX connections that should be nearly instantaneous. The only down-side is that in some rare situations, you might have to explicitly tell IC to refresh the connection list which will cause it to fall back to the heavyweight operation it has to use now. Hopefully that will be available soon.

    In the interim, I recommend that you keep your Salesforce CLI tidy by doing the following pretty regularly:

    • Run sfdx force:org:list --clean to remove all stale scratch org entries.
    • Run sfdx force:org:list and for every non-scratch org entry that doesn't show a value of Connected for CONNECTED STATUS, run sfdx force:auth:logout -u <username> to remove it as well.
    • Remove any other entries from the output of sfdx force:org:list that you no longer care about.

    The issue is that force:org:list currently tries to connect to and pull status from every one of these entries, and it does all of that in a serial fashion. By doing the above, I've seen folks reduce the runtime of that command from minutes to single-digit seconds.

  2. Scott Wells repo owner

    I think the issues driving this should be resolved by the changes in 2.1.3.9 (and a few previous releases upon which that one builds).

  3. Log in to comment