This repository was archived by the owner on May 20, 2025. It is now read-only.
Adding new restartImmediately flag to the apply method #43
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
This adds a new parameter to the
LocalPackage.applymethod which allows the app dev to specify whether they want the app to be restarted immediately or not. The default parameter is to restart the app, which allows backwards compatibility.This flag is useful for implementing a "silent install" experience, where you want to check for the update, download and apply it in the background, but don't forcibly restart the app. In this case, when the user naturally restarts their app (either because the OS killed it, or they closed it themselves), the app would "pick up" the downloaded update on the first run.
The bulk of this change is simply making sure that the existing
isFirstRunproperty and rollback timeout support continue to work. We discussed allowing doing the restart or resume as well, but I couldn't think of a particularly compelling reason to restart on resume, from an end-user experience.