Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Update hangs on "Installing update" #240

Closed
marpstar opened this issue Apr 5, 2017 · 4 comments
Closed

Update hangs on "Installing update" #240

marpstar opened this issue Apr 5, 2017 · 4 comments

Comments

@marpstar
Copy link

marpstar commented Apr 5, 2017

Description

After deploying an update to CodePush, my iOS simulator and device see the update, download the update (questionable, see below), and get stuck trying to install the update.

I've got everything set up inside of an Ionic 2 app. After the app has loaded and the user hits the login screen, I call sync(). I see the console notifications for "Checking..." then "Downloading..." then finally "Installing", where it hangs indefinitely.

I've been able to get the update mechanism to work only once. I can download the update package with the provided download URL, and everything looks correct.

One potential oddity I did notice was in the network traffic: after the call to the updateCheck method on the server, there's another call to a download method on the CodePush server. This download call returns a 2-byte response (OK), and nothing else happens? Maybe this is expected behavior.

I've debugged through the code and it seems to narrow down to this line of code. It goes into the call to FileUtil.readFileEntry(manifest, callback), and callback is never called. Digging even deeper into fileUtil.js, I can see that neither onloadend nor onerror callbacks for fileReader are ever hit after I step over fileReader.readAsText(file).

Additional Information

  • cordova-plugin-code-push version: 1.9.3-beta
  • Cordova version: 6.5.0
  • iOS version: 10.3
  • Does this reproduce on a debug build or release build? Debug
  • Does this reproduce on a simulator, or only on a physical device? Both
@max-mironov
Copy link
Contributor

@marpstar - hi, thank you for your question.
Can you share with us the the links that points to your release content urls (the best is to share the output of code-push deployment history AppName DeploymentName --format json command).
Also can you verify the output of your empty response in network tab of your debugger (that is your 2byte response), is there anything you can see here?

Have you tried to release another update to see if you will be able to apply it?

@marpstar
Copy link
Author

marpstar commented Apr 5, 2017

@max-mironov

In reference to the network tab, the response from the download call is 2-bytes, literally just the characters OK.

I have pushed several releases and have no been able to consistently get them to download.

@marpstar
Copy link
Author

marpstar commented Apr 5, 2017

Upon further investigation, it looks like the problem was related to these issues with Ionic and zone.js

With the key point being that the reference to cordova.js should be after loading the typical polyfills.js bundle for Angular/Ionic apps which contains zone.js. Zone.js seems to be the culprit.

Loading cordova.js AFTER loading polyfills.js seems to have resolved this problem for me.

Closing this issue. Thanks for your help!

@marpstar marpstar closed this as completed Apr 5, 2017
@max-mironov
Copy link
Contributor

@marpstar - awesome, thank you so much for detailed investigation of the issue, would be useful for further reference if we see same issues with ionic.

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

No branches or pull requests

2 participants