This repository was archived by the owner on May 20, 2025. It is now read-only.
Restart on resume #51
Merged
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 extends/replaces the previous
restartImmediatelyflag by allowing the caller to pass arestartModetoLocalPackage.apply, which adds the ability to restart the app on the next resume, as opposed to simply restarting immediately or not. The default value when a mode isn't specified is still "immediate", but this change gives devs more options, particularly if they want to employ a "silent update" mechanism, which doesn't immediately restart the app, but does on the next app resume.Moving forward, we could also expose an API to script that allows restarting the app at a custom, app-specific time, that way you apply the update, specifying a restart mode of none, and then force the restart sooner at a point the app can determine is acceptable (e.g. the end-user navigated back to the home page).
This change only impacts the
LocalPackage.applymethod. We need to determine how to best expose therestartModeviasync, in a way that still respects theisMandatoryoption of an update and doesn't allow the app to have a weird update experience (e.g. not applying the update immediately is kind of strange when you asked the end-user for permission to install it). We'll address that in a future PR, along with exposing the newprogressCallbackfeature that was added to theRemotePackage.downloadmethod.