w3c / w3c/ServiceWorker

Should Cache#addAll reject with AbortSignal's reason if the signal is already aborted?

Open
#1,684 3 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

Based on https://dom.spec.whatwg.org/#dom-abortsignal-abort, when a signal is aborted, the abort reason would be set to the given reason or a new AbortError DOMException.

Currently, in Step 5-7-3-1 in https://w3c.github.io/ServiceWorker/#dom-cache-addall, it says

If response’s aborted flag is set, reject responsePromise with an "AbortError" DOMException and abort these steps.

so it will always reject the response promise with an AbortError DOMException.

Should it reject with the signal's abort reason instead?

Note: In fetch method, in Step 4-1, when the signal is already aborted, fetch will reject with the signal's reason.

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

Read the Service Worker Cache#addAll step 5-7-3-1 alongside the linked DOM AbortSignal and Fetch algorithms. Determine whether the specification should align its rejection behavior with the signal's abort reason, then confirm the intended normative wording and update the relevant specification text once resolved.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
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.