Ideas for logging mobile hot reload decisions

We frequently have seemingly random problems with certain users not getting asked to hot reload on iOS or Android. (We intercept using reload-on-resume and prompt them to update manually.)

There are an increasing number of reasons why this might happen. A few:

  • If the server wasn’t built properly, it doesn’t serve the cordova manifest
  • Could be some error in the native code
  • Could be intentional due to cordova plugins having changed when the server was built
  • Could be an error in the javascript
  • Could be user error

We are interested in helping develop something to get a full picture of what is happening here. Ideally I think it would be some type of logging baked into the Meteor cordova plugin and/or hot reload packages. I’d be happy to get a start on this if MDG is on board.

One idea is to keep a timestamped log of things that happen on the device in localstorage. When was a manifest received? Was it parseable or was it the default HTML being served? Was there a new version detected? Did we decide not to reload due to cordova plugins changed? Did we try to download the new files? Did that succeed? Did we refresh the app? Did that succeed?

We’d like to take such a log and display it on our app’s help screen to help with support and identifying patterns.

Some of these things happen in native code, so I’m not completely sure what type of bindings we’d need to pass through to JS.

I’d like any feedback on this approach or other ideas/wishlist from @martijnwalraven and anyone who cares. Thanks

This won’t give you all the events, but for errors you could pass a callback to WebAppLocalServer.onError (see here) and do the logging from there.

Seemingly you’d need cordova-plugin-meteor-webapp bundled with the app store release to access WebAppLocalServer, without is there anything undocumented in Reload?

EDIT: if there isn’t a method and i’d have to fork think this may be the right place ?