- From: Monica Chintala <notifications@github.com>
- Date: Fri, 31 Jul 2026 15:23:50 -0700
- To: w3c/ServiceWorker <ServiceWorker@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3c/ServiceWorker/pull/1839@github.com>
This is a small follow-up related to #1740.
The rejection path inside the `[[service worker queue]]` block of `InstallEvent.addRoutes()` was calling `Reject |promise|` directly from a parallel queue. Rejecting a JS promise from a parallel queue crosses the event-loop/parallel boundary and is the same pattern that #1740 flags across the spec.
This PR:
- Wraps the rejection in a `Queue a task` on the service worker's event loop, using the DOM manipulation task source, matching the existing resolve path a few lines below.
- Adds an `Abort these steps.` after the rejection queue so we don't fall through to `Set |serviceWorker|'s list of router rules` and the follow-up resolve on the same promise.
- Hoists `Let |serviceWorkerEventLoop| be the current global object's event loop.` above the `[=queue/Enqueue=]` block so both the reject and resolve tasks can reference it (and so the event loop is captured on the event-loop side, not inside the parallel queue).
Editorial only, no normative behavior change beyond making the failure path stop after rejecting (which it should already do — the previous text would set the rules and resolve after rejecting, which was a bug in the failure path).
Refs: #1740
<!--
This comment and the below content is programmatically generated.
You may add a comma-separated list of anchors you'd like a
direct link to below (e.g. #idl-serializers, #idl-sequence):
Don't remove this comment or modify anything below this line.
If you don't want a preview generated for this pull request,
just replace the whole of this comment's content by "no preview"
and remove what's below.
-->
***
<a href="https://pr-preview.s3.amazonaws.com/monica-ch/ServiceWorker/pull/1839.html" title="Last updated on Jul 31, 2026, 10:23 PM UTC (40bc41b)">Preview</a> | <a href="https://pr-preview.s3.amazonaws.com/w3c/ServiceWorker/1839/e91ddff...monica-ch:40bc41b.html" title="Last updated on Jul 31, 2026, 10:23 PM UTC (40bc41b)">Diff</a>
You can view, comment on, or merge this pull request online at:
https://github.com/w3c/ServiceWorker/pull/1839
-- Commit Summary --
* Editorial: queue a task to reject promise in InstallEvent.addRoutes
-- File Changes --
M index.bs (7)
-- Patch Links --
https://github.com/w3c/ServiceWorker/pull/1839.patch
https://github.com/w3c/ServiceWorker/pull/1839.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/pull/1839
You are receiving this because you are subscribed to this thread.
Message ID: <w3c/ServiceWorker/pull/1839@github.com>
Received on Friday, 31 July 2026 22:23:54 UTC