skipWaiting() promise should resolve after promotion to .active
Nobody has claimed this yet.
- Dominant language
- Bikeshed
- Stars
- 3.6k
- Forks
- 324
- Avg merge
- 14d 22h
- Merged PRs (30d)
- 1
Description
As spec'd the skipWaiting() promise doesn't seem really useful. I think it might be an oversight.
I'd expect the promise to resolve after the worker has been promoted to .active and has state 'activating'.
But currently the spec is:
2. Invoke Try Activate with service worker's containing service worker registration.
3. Resolve promise with undefined.
And Try Activate early returns in some cases:
- existing active worker is still activating
- the existing active worker has pending events
So if Try Activate early returned, we resolve the promise before activating.
Also am I parsing this sentence correctly: "The result of running Service Worker Has No Pending Events with registration’s active worker is true, and no service worker client is using registration or registration’s waiting worker's skip waiting flag is set." means "A && (B || C)" where A = "no pending events", B = "no client" and C = "skip waiting flag".
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the skipWaiting() algorithm and the Try Activate algorithm described in this issue. Trace the early-return conditions and the promise-resolution step, then verify the logical reading of the Service Worker Has No Pending Events condition. Done means the specification clearly defines when skipWaiting() resolves and the condition is unambiguous.
Written by the indexing model from the issue text.
Assessment
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100