Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue about ConnectInstaller #17

Closed
dawei-medaitek opened this issue Apr 6, 2022 · 4 comments
Closed

Issue about ConnectInstaller #17

dawei-medaitek opened this issue Apr 6, 2022 · 4 comments

Comments

@dawei-medaitek
Copy link

dawei-medaitek commented Apr 6, 2022

Dear Sir, hope you well , I have some questions,
when I check ConnectInstaller status through below code, asperaInstaller.showDownload() executed, but

  1. "Step 1" show extention has been installed? but actually I didn't install extention
  2. when I click Install Connect, nothing happened.
  3. can I specify the version of Connect ? now it shows {3.9.1}
 const checkAsperaConnectStatus = () => {
        asperaUploadClient = new Connect({ connectMethod: 'http' });
        asperaInstaller = new ConnectInstaller({
            sdkLocation: '//d3gcli72yxqn2z.cloudfront.net/connect/v4'
        });

        asperaUploadClient.addEventListener(Connect.EVENT.STATUS, statusEventListener);
        asperaUploadClient.initSession();
    }



    const statusEventListener = function (eventType, data) {
        if (eventType === Connect.EVENT.STATUS && data === Connect.STATUS.INITIALIZING) {
            console.log('Aspera Connect Client is initializing');
            asperaInstaller.showLaunching();
        } else if (eventType === Connect.EVENT.STATUS && data === Connect.STATUS.FAILED) {
            console.log('Aspera Connect Client failed to load');
            asperaInstaller.showDownload();
        } else if (eventType === Connect.EVENT.STATUS && data === Connect.STATUS.OUTDATED) {
            console.log('Aspera Connect Client is Outdated');
            asperaInstaller.showUpdate();
        } else if (eventType === Connect.EVENT.STATUS && data === Connect.STATUS.RUNNING) {
            console.log('Aspera Connect Client is now Running');
            asperaInstaller.connected();
            asperaUploadClient.removeEventListener(Connect.EVENT.STATUS, statusEventListener);
        }
    };

Capture

@dwosk
Copy link
Member

dwosk commented Apr 6, 2022

Hi @dawei-medaitek, see my answers below -

  1. This particular installation UI (i.e. the two-step banner) was designed with the extension strategy in mind. Since you have it configured to use http instead, the UI won't quite match up with what you need to do in order to get Connect working with your web application. But this brings up a good point - the installation UI should take into account what request strategy (i.e. connectMethod) is used. This will be more important if/when we switch back to http being the default again. So, for example, it would be better if the UI did not show "Install Extension" at all if you use the http strategy. I'll create a separate ticket for this.
  2. It looks like the SDK failed to pass some of the required information to the UI (Connect version, links, etc.). The SDK loads a file (connectversions.min.js) from the URL you have specified for sdkLocation, from which it gathers the information above that is needed for the UI to work properly. The characteristic sign of something going wrong is seeing {3.9.1} in the text (it should be replaced by the actual Connect version being offered to download). On a side note, I think the UI behavior when this step fails could be improved. To troubleshoot this, start by looking at the Developer console, see if that file is loaded or blocked. As stated in the README, you can turn on debug logging in the Developer console by running AW4.Logger.setLevel(2). Also, make sure that the domain that's hosting the Connect SDK (asperaweb-4.js) is the same one that you have set for sdkLocation in ConnectInstaller. In other words, by looking at your code snippet, make sure you are embedding the Connect SDK (asperaweb-4.js) from https://d3gcli72yxqn2z.cloudfront.net/connect/v4/asperaweb-4.js to match up what you have in sdkLocation. If they are different, it could cause problems like this.
  3. The {3.9.1} issue will go away once you figure out (2). I'm assuming you are using v4.x of the Connect SDK. In v5 you can actually specify the particular Connect version you want to offer - see MIGRATION for more details.

@dwosk
Copy link
Member

dwosk commented Apr 6, 2022

Tracking the UI update for the HTTP strategy as described in (1) in #18.

@dawei-medaitek
Copy link
Author

dawei-medaitek commented Apr 7, 2022

Hi @dwosk , I found what caused my issue, after read https://github.com/IBM/aspera-connect-sdk-js/blob/main/MIGRATION.md , My library version is NPM source v5.0.0-pre.1 , but the code method is v4 (reference the example codes) , now i change code to below, it works fine.

asperaUploadClient = new Connect({});
         asperaInstaller = new ConnectInstaller({});

@dwosk
Copy link
Member

dwosk commented Apr 7, 2022

Ok great, glad the migration guide was able to clarify things. You can omit the empty objects when instantiating the classes to simplify things further:

asperaUploadClient = new Connect();
asperaInstaller = new ConnectInstaller();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants