nordnet/cordova-hot-code-push

Add `chcp_beforeFetch` event

Closed this issue · 4 comments

Problem

There is no event for when fetch is initiated. This makes it hard to tell if the remote update system is behaving correctly. When a fetch is triggered automatically (via auto-download) or manually (via chcp.fetchUpdate()) the plugin should either emit a chcp_nothingToUpdate event (existing) or chcp_beforeFetch (proposed).

Currently, if fetch is initiated, there is no event until the fetch either completes with chcp_updateIsReadyToInstall or fails with chcp_updateLoadFailed. Depending on the size of the update and conditions (primarily network bandwidth) there may be a long delay before either of these events occurs, making it hard to determine if the plugin is working correctly. It is hard to tell if there is a update fetch in progress or if something has gone wrong, such as a build/config problem or the server is currently inaccessible or not responding.

Related to this, it would also be ideal to see feedback on the server side of the update, as suggested in this issue: nordnet/cordova-hot-code-push-cli#64

Steps to reproduce
  1. Create an app with cordova-hot-code-push and log/display all available events in https://github.com/nordnet/cordova-hot-code-push/wiki/Listen-for-update-events
  2. Serve an update using cordova-hot-code-push-cli cordova-hcp server
  3. Build and deploy the app
  4. Modify a large file in the www directory
  5. Trigger a resume event on the device and then wait for the update to to get fetched. Note that there are no events logged until after the update is fetched.

Yep, that can be added.

Bolik commented

+1 vote for this feature request

+1 too. We would like to abort a fetch based on business logic.

👋 Hi! Thank you for your interest in this repo.

😢 We are not using nordnet/cordova-hot-code-push anymore, and we lack the manpower and the experience needed to maintain it. We are aware of the inconveniece that this may cause you. Feel free to use it as is, or create your own fork.

🔒 This will now be closed & locked.

ℹ️ Please see #371 for more information.