Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(aio): activate ServiceWorker updates asap #17699

Merged
merged 1 commit into from
Jul 7, 2017

Commits on Jul 7, 2017

  1. fix(aio): activate ServiceWorker updates asap

    Previouly, whenever a new ServiceWorker update was detected the user was
    prompted to update (with a notification). This turned out to be more distracting
    than helpful. Also, one would get notifications on all open browser tabs/windows
    and had to manually reload each one in order for the whole content (including
    the app) to be updated.
    
    This commit changes the update strategy as follows:
    - Whenever a new update is detected, it is immediately activated (and all
      tabs/windows will be notified).
    - Once an update is activated (regardless of whether the activation was
      initiated by the current tab/window or not), a flag will be set to do a
      "full page navigation" the next time the user navigates to a document.
    
    Benefits:
    - All tabs/windows are updated asap.
    - The updates are applied authomatically, without the user's needing to do
      anything.
    - The updates are applied in a way that:
      a. Ensures that the app and content versions are always compatible.
      b. Does not distract the user from their usual workflow.
    
    NOTE:
    The "full page navigation" may cause a flash (while the page is loading from
    scratch), but this is expected to be minimal, since at that point almost all
    necessary resources are cached by and served from the ServiceWorker.
    
    Fixes angular#17539
    gkalpak committed Jul 7, 2017
    Configuration menu
    Copy the full SHA
    4c2afce View commit details
    Browse the repository at this point in the history