Alternate offline check - Looks like you have gone offline

Issue #261 resolved
Timothy Ubbens created an issue

I’ve been following several of the issues around the “Looks like you have gone offline” message (#225) and have noticed that the resulting updates have solved the issue in several places in the plugin for me. However, there are still a few places where I get the nagging error. I suspect that because I’m behind interesting proxies, the connection from VS Code isn’t working quite right. I modified src/util/online.ts lines 86 and 92 to point to http://localhost:3030 instead of the Atlassian links and fired up a simple local api server to respond to requests and the whole plugin immediately started working. I’m wondering whether you might be open to swapping out a hard-coded connection check against Atlassian’s servers with a connection check against the servers configured in the atlascode plugin settings?

Comments (14)

  1. Jonathan Doklovic Account Deactivated

    @Timothy Ubbens which version of the extension are you using? A while back we made a change that allows the online checker to use proxy settings if you have them setup.

    it’s the “getAgent()” call here:

    https://bitbucket.org/atlassianlabs/atlascode/src/master/src/util/online.ts#lines-93

    That being said, it doesn’t include any custom certs or pfx files you may have setup when you authenticated with a site.

    Do you know if your proxy uses any custom certs?

    Also, do you have http(s).proxy set in your vscode settings?

  2. Timothy Ubbens reporter

    I'm using plugin version 2.1.5. I'll check the proxy settings and get back to you on that

  3. Timothy Ubbens reporter

    I don't have the proxy set in my vscode settings.

    There are a number of different cases where an online connection test to bitbucket.org may have issues:
    1) orgs using internally hosted bitbucket or Jira, but user is remote & not connected to VPN - connection request will show online, but user is unable to connect to their instances - offline message should appear
    2) situations where bitbucket.org is up but bitbucket server instance is down
    3) orgs filtering network traffic for (external) destinations by user agent
    4) orgs with self-signed certs at the proxy
    5) orgs with proxy requiring user auth for some user agents

    Although this feature would definitely help with proxy situations, it might be even more helpful displaying a useful error message in situations 1&2

  4. Jeremy Shipman

    My use case is working within a corporate network which doesn’t have any open proxy to the outside by default. Our Bitbucket server instance lives within the network, which is accessible, but this extension thinks I’m offline so prevents me from fetching PR details.

  5. Jonathan Doklovic Account Deactivated

    Alright. I’m convinced. 🙂 I’ll add a feature request for this on our backlog.

  6. Gregory Star Account Deactivated

    Hi Timothy,

    This is now fixed in our latest release. If you update the extension and go to the extension configuration, press on the ‘General’ tab, and open the ‘Connectivity’ panel you should see a list of URLs the extension will ping. Happy coding!

  7. Log in to comment