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

What happens if waitUntil rejects? #115

Closed
jakearchibald opened this issue Nov 1, 2013 · 2 comments
Closed

What happens if waitUntil rejects? #115

jakearchibald opened this issue Nov 1, 2013 · 2 comments

Comments

@jakearchibald
Copy link
Contributor

this.oninstall = function(event) {
  var core = new Cache(
    // urls
  );

  caches.set('core', core);
  event.waitUntil(core.ready());
};

If the cache fails to download & its ready promise rejects what happens?

Feels like the install would be abandoned & retried on the next page navigation to a url covered by the worker, after checking for updates to the controller.

What about onactivate? Same again - retry on next navigation after checking for updates?

@KenjiBaheux
Copy link
Collaborator

@jakearchibald
Does the latest spec capture the expected behavior? I'm thinking of the following sentence: "If any oninstall handler throws an exception, or if any lifetime extension via event.waitUntil() fails (via promise rejection), installation fails and activation is not carried out. "

Should this issue be closed? If not can you explain what's missing?

Background:
I'm going over the open issues, hoping to understand the potential impact against our current implementation.

@jakearchibald
Copy link
Contributor Author

Yep, spec is correct. Thanks for going through these issues!

(note: activateEvent.waitUntil(Promise.reject) doesn't prevent activation)

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

2 participants