Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Conversation

@lostintangent
Copy link
Member

This adds a new parameter to the LocalPackage.apply method 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 isFirstRun property 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.

@msftclas
Copy link

Hi @lostintangent, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!


It looks like you're a Microsoft contributor (Jonathan Carter). If you're full-time, we DON'T require a Contribution License Agreement. If you are a vendor, please DO sign the electronic Contribution License Agreement. It will take 2 minutes and there's no faxing! https://cla.microsoft.com.

TTYL, MSBOT;

CodePush.m Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

necessary

CodePush.m Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

@dtivel
Copy link
Member

dtivel commented Nov 10, 2015

Looks good.

@geof90
Copy link
Contributor

geof90 commented Nov 10, 2015

LGTM!

README.md Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to just fix a few nittish things and rephrase slightly, is this okay? (You can edit this comment if you want the source)

  • apply(rollbackTimeout: Number = 0, restartImmediately: Boolean = true): Promise<void>: Applies this package to the application by unzipping its contents (e.g. the JS bundle) and saving it to the location on disk where the runtime expects to find the latest version of the app. If the restartImmediately parameter is set to false, the apply will complete, but it won't take effect until the next time that the app is restarted. Otherwise, the app will be immediately restarted after performing the apply, so that the end-user sees the changes.

    If a value greater than zero is provided to the rollbackTimeout parameter, the application will wait for the notifyApplicationReady method to be called for the given number of milliseconds.

Also, again a little nittish, but is it a bit strange that we are talking about 'restartImmediately' before we talk about 'rollbackTimeout', considering the arguments are the other way around?

@richardhuaaa
Copy link
Contributor

Looks good!

lostintangent added a commit that referenced this pull request Nov 11, 2015
Adding new restartImmediately flag to the apply method
@lostintangent lostintangent merged commit 79e4c50 into master Nov 11, 2015
@lostintangent lostintangent deleted the applyImmediately branch November 11, 2015 00:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

6 participants