Git Product home page Git Product logo

Comments (12)

Fuiste avatar Fuiste commented on June 12, 2024 1

@ibcooley and @joshgarwood whoops, looks like we weren't resolving the extract promise correctly, we're working on a fix right now and will update you soon!

Mentioning this here, but it's just as applicable to #13 (comment)

from ionic-cloud-angular.

Fuiste avatar Fuiste commented on June 12, 2024

@joshgarwood extract() will simply extract the update and save it to your device, to actually apply it you will then need to call load().

Here's an example from one of my testing apps:

  deploy.check().then((hasUpdate: boolean) => {
    if (hasUpdate) {
      deploy.download().then(() => {
        deploy.extract().then(() => {
          deploy.load();
        }, (error) => {
          console.log("Error extracting: " + error);
        })
      }, (err) => {
        console.log("Error downloading: " + err);
      });
    }
  }, (cErr) => {
    console.log("Check error: " + cErr);
  })

As to your extract failing, I'd look to your logs to see if any errors are happening. I can't be certain what's going on from the code above, and can't reproduce the issue.

from ionic-cloud-angular.

imhoffd avatar imhoffd commented on June 12, 2024

@joshgarwood We don't recommend calling load(), though, as it immediately refreshes the app, instead of just loading up the new app snapshot when the app is started again. Are you on Android or iOS?

from ionic-cloud-angular.

joshgarwood avatar joshgarwood commented on June 12, 2024

Hey guys! Thanks so much for the quick responses.

@Fuiste I am actually calling deploy.load() in my handleUpdateResponse() function if the extract was successful. But it never gets called because the success parameter in the extract() callback is always false. As well, my logs don't indicate any failure. In looking at the ionic-cloud deploy.ts (line 169), there isn't any log output for this scenario... The extract() doesn't throw an error, it's just that success is false.

@dwieeb That's definitely good to know. I am currently calling load() in the event of a successful extract... are there potential issues with that? I've seen some odd behavior (such as my app always going back to the splash screen after opening from the background). I am on Android.

Thanks again guys, y'all are awesome!

from ionic-cloud-angular.

joshgarwood avatar joshgarwood commented on June 12, 2024

Sorry to be such a pest, but do either of you know if it's possible to expose a more useful error message (or add more detailed logging) for the extract() method in the deploy plugin? That may help me diagnose my issue.

Thanks!

from ionic-cloud-angular.

imhoffd avatar imhoffd commented on June 12, 2024

@joshgarwood The error messages from the deploy plugin are going to be very unhelpful. We're aware of this and we want to take a look at modernizing the plugin and perhaps providing a better API as soon as we can. For now, you can do adb logcat and try to look at the deploy plugin logs. You should be able to grep for "IONIC".

from ionic-cloud-angular.

ibcooley avatar ibcooley commented on June 12, 2024

Similar to @joshgarwood, i've seen an issue where the extract method promises to return a boolean, but returns false even if successful. Perhaps that is the problem?

From your examples above, it appears that you disregard the boolean return value as it comes from extract. Is that intentional?

My code is below

this.deploy.download().then((success) => {
    let message = success ? 'Update successfully installed.' : 'An error occurred while updating the app';
    if (success) {
        this.deploy.extract().then(success => {
                        //TODO: proper extraction success checking
            console.log("extract success: " + success); //is false
            this.deploy.load();
        }).catch(err => console.log("Extract Failed:" + JSON.stringify(err)));
    }
    this.loading.hide().then(() => { resolve(message) });
}).catch(err => {
    this.loading.hide().then(() => { resolve('An error occurred while updating the app: ' + err) });
});

from ionic-cloud-angular.

imhoffd avatar imhoffd commented on June 12, 2024

What devices are you guys trying this on (specifically)? @joshgarwood @ibcooley

from ionic-cloud-angular.

ibcooley avatar ibcooley commented on June 12, 2024

@joshgarwood and I work on the same dev team, btw.
But our team has had issues with the following:

  • iPhone 6
  • Genymotion Emulator
  • HTC M8

My ADB log when extracting is completing looks like this:

09-02 17:09:30.517 29524 29598 I IONIC.DEPLOY.EXTRACT: Progress: 90%
09-02 17:09:30.518 29524 29598 I IONIC.DEPLOY.EXTRACT: Progress: 92%
09-02 17:09:30.519 29524 29598 I IONIC.DEPLOY.EXTRACT: Progress: 93%
09-02 17:09:30.524 29524 29524 W art     : Attempt to remove non-JNI local reference, dumping thread                    09-02 17:09:30.538 29524 29598 I IONIC.DEPLOY.EXTRACT: Progress: 95%
09-02 17:09:30.540 29524 29598 I IONIC.DEPLOY.EXTRACT: Progress: 96%
09-02 17:09:30.543 29524 29598 I IONIC.DEPLOY.EXTRACT: Progress: 98%
09-02 17:09:30.543 29524 29598 I IONIC.DEPLOY.EXTRACT: Progress: 100%
09-02 17:09:30.554 29524 29598 I IONIC.DEPLOY.REMOVE: Removed www.zip
09-02 17:09:30.590 29524 29524 W art     : Attempt to remove non-JNI local reference, dumping thread
09-02 17:09:30.657 29524 29524 W art     : Attempt to remove non-JNI local reference, dumping thread
09-02 17:09:30.700 29524 29524 I chromium: [INFO:CONSOLE(29)] "extract success: false", source: http://192.168.1.2:8100/ (29)
09-02 17:09:30.700 29524 29524 I IONIC.DEPLOY.REDIRECT: Loading deploy version: a0550e7a-7137-11e6-8871-bed395d43cc5

Notice the "extract success: false" line.

from ionic-cloud-angular.

ibcooley avatar ibcooley commented on June 12, 2024

That is excellent news!
👍

from ionic-cloud-angular.

Fuiste avatar Fuiste commented on June 12, 2024

@ibcooley and @joshgarwood we just released a new version of ionic-cloud-angular which addresses the issue (0.4.0).

We've changed the download and extract promises to simply resolve on success and reject on failure, rather than resolving with a boolean, so your code may change slightly as a result.

Let us know if you still have any issues!

from ionic-cloud-angular.

ibcooley avatar ibcooley commented on June 12, 2024

@Fuiste, you guys are quick! thanks! We should be able to test this soon and let you know if it doesn't work, as expected.

edit: this seems to address one of the issues we were seeing! Will keep you updated on additional problems we may run into.

from ionic-cloud-angular.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.