meteor / cordova-plugin-meteor-webapp

Cordova plugin that serves a Meteor web app through a local server and implements hot code push
MIT License
66 stars 74 forks source link

android production app crashes on startup #66

Closed macrozone closed 5 years ago

macrozone commented 6 years ago

reason is this line https://github.com/meteor/cordova-plugin-meteor-webapp/blob/master/src/android/WebAppLocalServer.java#L168

there, configuration.getLastKnownGoodVersion() is null and crashes, because its not properly checked.

This is a very fatal bug, but i am not sure why it suddenly happens

At the moment i have absolutly no idea why this happens. It doesn't happen on a fresh install, only if you installed an update

Nauzer commented 6 years ago

I have had a similar experience in my production apps on Android. I think it happens if a running HCP/ Asset Bundle download does not finish and the app is closed and restarted. Do you have similar experience?

Nauzer commented 6 years ago

@macrozone is this also the behaviour you are experiencing?

Basically makes HCP very unreliable on Android since any app close on Android with an unfinished download in the background causes the app to become unresponsive upon next startup. Maybe someone at MDG should have a look at this as well.

wojtkowiak commented 6 years ago

Guys, this seems to be my fault. The biggest question is why I did not run into this running this code for 1,5yr+ on production. Surely this should've been written the other way !lastDownloadedVersion.equals(configuration.getLastKnownGoodVersion()) as `lastDownloadedVersion is already checked for null ...

macrozone commented 6 years ago

@wojtkowiak I wondered what to do in the case where configuration.getLastKnownGoodVersion() is null, that's why i added another check explicitly: https://github.com/meteor/cordova-plugin-meteor-webapp/pull/67

macrozone commented 6 years ago

by the way, i needed to hot-patch my change to a production app... not very happy with that, but at least i could push a release that did not crash on every startup.

in case anyone needs it, add this to cordova-plugins:

cordova-plugin-meteor-webapp@https://github.com/panter/cordova-plugin-meteor-webapp.git#5cd38aa39d421934a9365cd7336db86d4c81ada5