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

A way to coordinate the refresh of all controlled windows to facilitate an upgrade #422

Open
jakearchibald opened this issue Aug 21, 2014 · 1 comment

Comments

@jakearchibald
Copy link
Contributor

This used to be clients.reloadAll(), which still feels like the right name, but I don't think we've thought about this enough to make it "version 1".

Here's what we had before I took out of the ts:

    // Assists in restarting all windows
    //
    // Return a new Promise
    // For each attached window:
    //   Fire onreloadpage against navigator.serviceWorker
    //   If onreloadpage has default prevented:
    //     Unfreeze any frozen windows
    //     reject returned promise
    //     abort these steps
    //   If waitUntil called on onreloadpage event:
    //     frozen windows may wish to indicate which window they're blocked on
    //     yeild until promise passed into waitUntil resolves
    //     if waitUntil promise is accepted:
    //       freeze window (ui may wish to grey it out)
    //     else:
    //       Unfreeze any frozen windows
    //       reject returned promise
    //       abort these steps
    //   Else:
    //     freeze window (ui may wish to grey it out)
    // Unload all windows
    // If any window fails to unload, eg via onbeforeunload:
    //   Unfreeze any frozen windows
    //   reject returned promise
    //   abort these steps
    // Close all connections between the old worker and windows
    // Activate the new worker
    // Reload all windows asynchronously
    // Resolve promise

@annevk pointed out that you can have a controlled SharedWorker being used by non-controlled pages. We don't have the concept of reloading a SharedWorker at the moment, so we need to overcome that.

@h2non
Copy link

h2non commented Dec 10, 2014

+1

@jakearchibald jakearchibald added this to the Future ideas milestone Oct 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants