Open csharrison opened 1 year ago
I chatted with @wanderview about this at TPAC and I think there is a bug in the Chromium implementation. I filed crbug.com/1364447 with more details.
I think the real fix to this is to:
Note that (2) does stop the duplication issue, but it might break some legit use-cases where SW are actually needed to use the API, it would be good to get feedback if this is the case.
Given the Chromium bug, renaming this issue to more accurately needs to be done w/in the proposal.
Do you have any news on the status of the issue? Also, it looks like the bug filing has moved to https://issues.chromium.org/issues/40185335 if I am not mistaken. And that the bug has not been fixed.
@agarant
Here is a common flow for "default" handling of requests going through service workers that doesn't work with the API. The case is a conversion ping which redirects through two domains.
Currently, the API does not support fetches from within service workers (at least, in the Chromium implementation - the spec is not defined right now on this matter), so there is only a single registration at (6), not one also at (5).
The problem is that the API registration should be associated with
ad2.com
, but it incorrectly gets associated withad1.com
because the Service Worker is just copying the response wholesale. Worse still, if ad1.com also wanted to register with API headers at (3), they would see very strange behavior indeed because their headers would get replaced with the headers from ad2.com.The workaround is to avoid the Service Worker URL interception entirely by not calling
respondWith
for the associated registrationfetch
events.Concretely, we should: ~~1. Highlight as a note in the spec the behavior on (6), and reference the workaround.