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
Wait for an active worker on .register (consistency with push API) #101
Comments
I believe you mean between steps 2 & 3 of https://slightlyoff.github.io/BackgroundSync/spec/#dom-syncmanager-register perform step 5 of Push's subscribe method (the link is totally broken for some reason). Hmm, should we instead just fail if the registration isn't active? |
Hmm, sorry for the broken links. The first is my fault, not sure what's going on with the second.
That's what I thought push did, but seems they wait. @beverloo I guess there was some discussion around this? |
Yes. One flow that provided a lot of early feedback was the following:
Which, on first load, would fail because the registration hadn't been activated yet. Instead, the developer had to do the following:
Many of the Service Workers we saw for Push didn't have oninstall/onactivate/onfetch events at all. This probably is less of a concern for background sync (which'd depend on the caches?), but still something to consider. |
I can imagine many cases where the cache isn't needed (e.g., for puts instead of gets) for background sync. Waiting for the active registration works for me if that's the norm. |
(The second link was broken because it's a respec spec, so the link target just doesn't exist until some time after the page has loaded...) I'm not sure what the benefit would be of failing if the registration doesn't have an active worker yet? So I agree that yes, register should wait for the registration to have an active worker. |
Between steps 2 & 3 of https://slightlyoff.github.io/BackgroundSync/spec/#in-the-background, perform step 5 of https://w3c.github.io/push-api/#widl-PushManager-subscribe-Promise-PushSubscription--PushSubscriptionOptions-options
This prevents
.register
appearing to succeed, but never getting an active worker to fire a sync event in.The text was updated successfully, but these errors were encountered: