w3c / w3c/ServiceWorker

InstallEvent.addRoutes is resolving/rejecting the returned promise synchronously

Open
#1,742 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Bikeshed
Stars
3.6k
Forks
324
Avg merge
14d 22h
Merged PRs (30d)
1

Description

addRoutes currently returns a promise without using the ability to resolve/reject the promise asynchronously.
Looking at Chromium implementation, it seems that the promise is resolved asynchronously (probably after storing the route out of process).

The spec could be written as follows:

  1. Validate parameters synchronously, reject as needed (like current spec)
  2. If parameters are valid, In parallel, try storing the new route
  3. If storing the route fails, queue a task to reject the promise
  4. Otherwise, queue a task to resolve the promise

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the InstallEvent.addRoutes specification and compare its promise behavior with the Chromium implementation. Check how synchronous validation, parallel route storage, and queued resolution or rejection are currently described. Done means the specification clearly defines asynchronous settlement for valid parameters while preserving synchronous validation failures.

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
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.