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 HCP fails with 1.6.3 and 1.6.2 #69

Closed lorensr closed 5 years ago

lorensr commented 5 years ago

Haven't tested iOS.

Problem behavior: when a change is made to the client, the app doesn't refresh. Occurs with 1.6.3 and 1.6.2. Does not occur with 1.6.0.

Repro:

meteor create hcp --release 1.8.1-beta.13
cd hcp
meteor add-platform android
meteor run android-device --mobile-server="http://wifi-ip:3000"

Once app has loaded, edit client/index.html. Then repeat with this in .meteor/cordova-plugins:

cordova-plugin-meteor-webapp@1.6.0

Output with 1.6.3:

https://gist.github.com/lorensr/4ef1d0b41e18b120b0a056a5473b26a9

The messages about "good version" and "skipping" make sense given the behavior: the initial version is fa7 and it for some reason skips downloading all new versions.

Output with 1.6.0:

=> Started your app.

=> App running at: http://localhost:3000/
=> Started app on Android Device.
I20190112-02:32:40.761(1)? I/CordovaLog( 4476): Changing log level to DEBUG(3)
I20190112-02:32:40.802(1)? I/chromium( 4476): [INFO:library_loader_hooks.cc(36)] Chromium logging enabled: level = 0, default verbosity = 0
I20190112-02:32:40.803(1)? I/MeteorWebApp( 4476): Serving asset bundle with version: b8dedbc4919bb656a23a79e4cf1baafec6fd98db
I20190112-02:32:41.259(1)? I/MeteorWebApp( 4476): Serving asset bundle with version: 3c38e6e5055e8d3510b021a365416273b35abbb2
I20190112-02:32:42.537(1)? I/MeteorWebApp( 4476): Skipping downloading current version: 3c38e6e5055e8d3510b021a365416273b35abbb2
=> Client modified -- refreshingI20190112-02:33:28.681(1)? I/MeteorWebApp( 4476): Serving asset bundle with version: 3f2e595f0c1129230a4542ad24ef1c8faa2d43b8
I20190112-02:33:29.833(1)? I/MeteorWebApp( 4476): Skipping downloading current version: 3f2e595f0c1129230a4542ad24ef1c8faa2d43b8
=> Client modified -- refreshing (x2)I20190112-02:33:47.526(1)? I/MeteorWebApp( 4476): Serving asset bundle with version: ab005c1591509687bf4280f4b46639a114611c01
I20190112-02:33:48.687(1)? I/MeteorWebApp( 4476): Skipping downloading current version: ab005c1591509687bf4280f4b46639a114611c01

Output is weird. There are two different initial bundle versions, and it always skips, even though app is refreshing.

lorensr commented 5 years ago

I bisected the behavior to beginning here: 319cd3296b5f866ed7bd492cccf645318758d91c

When I incorporate this version of reload:

https://github.com/meteor/meteor/pull/10219

the app starts refreshing on each HCP, but not to the new version—to the same version. Output now talks about a pending version:

=> App running at: http://localhost:3000/
=> Started app on Android Device.
I20190112-04:36:21.571(1)? I/CordovaLog(16007): Changing log level to DEBUG(3)
I20190112-04:36:21.665(1)? I/chromium(16007): [INFO:library_loader_hooks.cc(36)] Chromium logging enabled: level = 0, default verbosity = 0
I20190112-04:36:24.504(1)? I/MeteorWebApp(16007): Skipping downloading pending version: a205c045e9b357027da45febb69963188b7e6936
=> Client modified -- refreshingI20190112-04:36:30.599(1)? I/MeteorWebApp(16007): Skipping downloading pending version: 132a95faef5a798f98a3365e15f4d98310064c94
=> Client modified -- refreshing (x2)I20190112-04:36:46.434(1)? I/MeteorWebApp(16007): Skipping downloading pending version: 9df33ace93b8487c11a0b66a82e9b141dfbce4ec

If I quit & restart the app, it loads the same version and repeats the last message Skipping downloading pending version: 9df33ace93b8487c11a0b66a82e9b141dfbce4ec

Repo: https://github.com/lorensr/cordova-plugin-meteor-webapp-69

cc @wojtkowiak

lorensr commented 5 years ago

Whoops, I did not successfully incorporate that version of reload. When I do, HCP works. However, on the first app start, it loads the bundled page, and then it refreshes to the same page. Output on 319cd32 is:

=> App running at: http://localhost:3000/
=> Started app on Android Device.
I20190113-01:08:13.025(1)? I/CordovaLog(29891): Changing log level to DEBUG(3)
I20190113-01:08:13.073(1)? I/chromium(29891): [INFO:library_loader_hooks.cc(36)] Chromium logging enabled: level = 0, default verbosity = 0
I20190113-01:08:13.615(1)? I/MeteorWebApp(29891): Switching pending version cfe88bf503c083f260ebe964235ea52f5f90840b as current version.

More verbose output on 1.6.3 is https://gist.github.com/lorensr/3d36702f7c50d74df2f94e1ebfe15e6b

Looks like the version hash calculated during app build is different from what the meteor server calculates. They should be the same until there's a change in the server's version of the client bundle.

lorensr commented 5 years ago

I tried 1.6.3 with a reverted 319cd32, and still got the above refresh-same-page problem. So it must have been introduced after 1.6.0 and before 319cd32.

levinse commented 5 years ago

The Android HCP issues in meteor 1.7.0.3 through to 1.8.1-beta.13 are causing us severe issues. We have over 70K users and we're getting negative reviews in the Google Play store because of the large and consistent number of failures.

benjamn commented 5 years ago

Just wanted to note that #10219 is now included in 1.8.1-beta.14, in case that makes things easier.

levinse commented 5 years ago

Thanks @benjamn. We've already tested that commit to the reload package manually over the weekend and unfortunately were still seeing the issues (a combination of download issues and reload issues, e.g. reloading to same version / reloading to initial / reloading to last known good etc.).

We can't get HCP to work reliably on Android regardless of meteor version or webapp plugin version or any other forks/patches we've tried. Seeing this on fresh meteor create apps as well, not just ours, so we've ruled out our code as the cause. This became much worse when we upgraded from meteor 1.6.x to 1.7.0.3.

Are we on our own or is this something MDG / someone else can help with if we contract them? We need to fix this quickly as this may be impacting our users quite negatively - they're basically getting stuck on white screens and need to reinstall the app.

levinse commented 5 years ago

@benjamn we are now re-testing on 1.8.1-beta.14 just in case there was a packaging issue / in case we didn't test the manual patch for #10219 properly. Now it appears that HCP may be fixed as of 1.8.1-beta.14, but we are performing further tests to confirm over the next 24-48 hours .

How close is the stable 1.8.1 release BTW? We are happy to help with any other testing needed to get this all wrapped up.

benjamn commented 5 years ago

I believe I found a fix for this issue: https://github.com/meteor/meteor/pull/10416/commits/a89b34c4c2d8335b337355eb61c382949ff762d9

levinse commented 5 years ago

Thanks! We will re-test tomorrow with our team!

benjamn commented 5 years ago

Just run meteor update --release 1.8.1-beta.15 to get the latest changes!

lorensr commented 5 years ago

Thanks a lot Ben—both the same-version reload bug I reported above and the post-build 100% HCP failure bugs are fixed in beta 15 😊