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

Should waitUntil() fast fail if a single extension promise rejects? #936

Closed
wanderview opened this issue Jul 27, 2016 · 2 comments
Closed
Labels
Milestone

Comments

@wanderview
Copy link
Member

Currently the waitUntil() logic says:

Wait until the result of waiting for all of extendLifetimePromises settles.

The waiting for all text links to Promise.all():

https://www.w3.org/2001/tag/doc/promises-guide#waiting-for-all

In turn, Promise.all() fast fails if a single promise in the array rejects.

This means that for things like FetchEvent.waitUntil() where rejection has no direct impact on SW life cycle or behavior, a rejection in one waitUntil() can cut off the behavior blocking another waitUntil(). Or it may not cut them off. Its basically a race between that second waitUntil() and the SW idle grace timer killing the worker.

Maybe this is ok, but I'm not sure its what people expect when they look at the API. Perhaps we should consider using an algorithm that waits for all promises to settle (one way or another) and then if any rejected passed the first error message it saw.

@jakearchibald
Copy link
Contributor

F2F:

  • Agree with @wanderview - rather than Promise.all we should wait on all promises to settle
  • This is what Chrome does already

@slightlyoff
Copy link
Contributor

Is it agreed? Should the "decided" label go on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants