From 4c4754d1cf80b4fff4e14a267aa235c8a56342ca Mon Sep 17 00:00:00 2001 From: Monica Chintala Date: Thu, 16 Jul 2026 13:45:21 -0700 Subject: [PATCH 1/2] Editorial: queue a task to resolve promise in ServiceWorkerContainer.getRegistration The step running in parallel resolved/rejected the promise directly, which violates the 'don't touch JS objects from parallel' rule. Wrap it in a Queue a task on the responsible event loop. Refs: #1740 --- index.bs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/index.bs b/index.bs index 7c11b834..a3744e5e 100644 --- a/index.bs +++ b/index.bs @@ -817,9 +817,10 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ 1. If the [=environment settings object/origin=] of |clientURL| is not |client|'s [=environment settings object/origin=], return a |promise| rejected with a "{{SecurityError}}" {{DOMException}}. 1. Let |promise| be a new promise. 1. Run the following substeps in parallel: - 1. Let |registration| be the result of running Match Service Worker Registration given |storage key| and |clientURL|. - 1. If |registration| is null, resolve |promise| with undefined and abort these steps. - 1. Resolve |promise| with the result of [=getting the service worker registration object=] that represents |registration| in |promise|'s [=relevant settings object=]. + 1. [=Queue a task=] on |promise|'s [=relevant settings object=]'s [=responsible event loop=], using the [=DOM manipulation task source=], to run the following steps: + 1. Let |registration| be the result of running Match Service Worker Registration given |storage key| and |clientURL|. + 1. If |registration| is null, resolve |promise| with undefined and abort these steps. + 1. Resolve |promise| with the result of [=getting the service worker registration object=] that represents |registration| in |promise|'s [=relevant settings object=]. 1. Return |promise|. From 55ed06e7eb885445c73a2b87cf571e7ec13256e7 Mon Sep 17 00:00:00 2001 From: Monica Chintala Date: Fri, 17 Jul 2026 09:10:36 -0700 Subject: [PATCH 2/2] Move Match Service Worker Registration out of Queue a task per review Per @yoshisatoyanagisawa: Match Service Worker Registration should stay in the parallel block so it runs in parallel; only the promise-resolution steps need to be inside the Queue a task. --- index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.bs b/index.bs index a3744e5e..0440d073 100644 --- a/index.bs +++ b/index.bs @@ -817,8 +817,8 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ 1. If the [=environment settings object/origin=] of |clientURL| is not |client|'s [=environment settings object/origin=], return a |promise| rejected with a "{{SecurityError}}" {{DOMException}}. 1. Let |promise| be a new promise. 1. Run the following substeps in parallel: + 1. Let |registration| be the result of running Match Service Worker Registration given |storage key| and |clientURL|. 1. [=Queue a task=] on |promise|'s [=relevant settings object=]'s [=responsible event loop=], using the [=DOM manipulation task source=], to run the following steps: - 1. Let |registration| be the result of running Match Service Worker Registration given |storage key| and |clientURL|. 1. If |registration| is null, resolve |promise| with undefined and abort these steps. 1. Resolve |promise| with the result of [=getting the service worker registration object=] that represents |registration| in |promise|'s [=relevant settings object=]. 1. Return |promise|.