The "Show SalesForce Setup" action stops working with DX projects after session times out

Issue #939 resolved
E.J. Wilburn created an issue

If you leave IDEA open long enough for your SFDC session to time out, then try to use IC's "Show SalesForce Setup" action the browser opens but redirects you to the login page. Preferably IC2 tracks the session timer and automatically start a new session if it's expired when I press the button.

Looking at the log you can see the first two invocations where I was taken to the login page, the third is where I ran "sfdx force:source:status" from the terminal before clicking it again. The first two attempts don't show the alias of the scratch org while the successful one does.

Comments (12)

  1. Scott Wells repo owner

    Thanks for reporting, E.J. Should be simple to address. In the interim, the Open Connection toolbar drop-down button should provide a workaround. If you don't see that, enable the toolbar using View>Toolbar.

  2. E.J. Wilburn reporter

    The Open Connection toolbar does the same thing when selecting the scratch org in question.

    I tried pulling the metadata after that and that worked, then I clicked Open Connection again and I got the listing connections popup before the drop-down was shown (which didn't happen previously) and then it worked when I selected the scratch org.

  3. Scott Wells repo owner

    Oh, and for what it's worth, IC (both 1 and 2) actually do accommodate for session timeouts for both traditional org and SFDX scratch org connections. For SFDX, IC uses the CLI to get the access token. The CLI is responsible to returning a valid access token (it didn't always work that way, but I've worked with the SFDX team to ensure it does). However, if an interaction with the server results in an invalid session ID, IC automatically uses the CLI to refresh the access the token and rebuilds the session.

    Something is obviously not working properly for you, so hopefully having insight into IC's interaction with the CLI will show me why.

  4. Scott Wells repo owner

    Thanks for the log, James. What version of the plugin are you using? I see a repeated stack trace in there that should be resolved with a more recent build of the plugin. If you're on the latest and still seeing these java.lang.NoClassDefFoundError: org/apache/commons/lang3/reflect/MethodUtils, I'll need to investigate that.

    Unfortunately I'm not seeing anything relating to the "Open connection" behavior in this log, though. I'll have to keep investigating the cause of this issue.

  5. Scott Wells repo owner

    FYI, I have been able to reproduce this. I'm toying with a few options to fix it. The fix won't be in the tomorrow's build, but I don't think there should be any issue getting it into the build after that.

  6. Phil W

    Hi Scott,

    Any movement on this? I’ve been able to work around this by opening the IDEA terminal window and doing the “sfdx force:org:display -u somealias” command and that somehow then re-enables the “Open connection” functionality (after doing this command clicking the drop list pauses while IC collects the list of SFDX connections). However, a colleague is finding that “Open connection” simply stops working and won’t start working again after running this command at a command prompt. (The browser window opens, but shows the Salesforce login prompt instead of directing straight to the scratch org.)

    Phil

  7. Scott Wells repo owner

    Phil, once again your timing is good. I'm hoping to include a fix for this in the next build if the approach I have in mind pans out. I'll try to get that out Friday or Monday.

  8. Scott Wells repo owner

    Delivered with 2.0.6.2. Now content is shown in the browser for SFDX-based projects using force:org:open which should ensure a valid access token/session ID.

  9. Log in to comment