Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear-Site-Data: clients uncontrolled by service workers #19132

Merged
merged 1 commit into from
Oct 7, 2019

Conversation

asakusuma
Copy link
Contributor

Adds a failing test, asserting that pages actively controlled by a service worker become uncontrolled after the Clear-Site-Data storage directive.

We agreed on this behavior in a spec issue and confirmed the need for this test at the TPAC Service Workers F2F.

w3c/ServiceWorker#614
F2F notes: https://docs.google.com/document/d/1_Qfw5m3BJEaL1xIzTJd41HXjgJ9gq7mroBDXqSJIzic/edit

clear-site-data/storage.https.html Outdated Show resolved Hide resolved
clear-site-data/storage.https.html Show resolved Hide resolved
clear-site-data/storage.https.html Outdated Show resolved Hide resolved
clear-site-data/support/test_utils.sub.js Outdated Show resolved Hide resolved
@asakusuma asakusuma force-pushed the csd-kill-sw branch 4 times, most recently from df264b5 to 9826852 Compare September 30, 2019 19:43
Copy link
Member

@mfalken mfalken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This lgtm, thanks.

clear-site-data/storage.https.html Outdated Show resolved Hide resolved
…e directive

Adds a failing test, asserting that pages actively controlled by a service worker become uncontrolled after the Clear-Site-Data storage directive.

We agreed on this behavior in a spec issue and confirmed the need for this test at the TPAC Service Workers F2F.

w3c/ServiceWorker#614
F2F notes: https://docs.google.com/document/d/1_Qfw5m3BJEaL1xIzTJd41HXjgJ9gq7mroBDXqSJIzic/edit
@mfalken
Copy link
Member

mfalken commented Oct 3, 2019

@msramek or @mikewest did you want to review this? Otherwise is it ready to merge? We still need to update the spec itself of course.

@msramek
Copy link
Contributor

msramek commented Oct 4, 2019

@mattto I haven't worked with this code for a while, so I don't think I have much to add beyond your code review.

I'm not sure what you mean by the spec update though; the Clear-Site-Data spec already states that "Service Workers registered for an origin are terminated and deregistered."

@asakusuma
Copy link
Contributor Author

@msramek thanks for chiming in. I believe @mattto is talking about updating the normative part of the spec, which only says to call unregister(), which does not terminate the worker or uncontrol clients. I'm assuming you are quoting the non-normative goals section of the Clear-Site-Data spec. So really the required spec change is just about updating the normative section to reflect the already stated non-normative goals, which you pointed out.

@msramek
Copy link
Contributor

msramek commented Oct 4, 2019

Ah, right. Makes sense. The Chromium implementation actually already works that way; it directly erases the service worker from the storage, instead of just going through the JavaScript codepath of calling unregister().

@asakusuma
Copy link
Contributor Author

@msramek the new tests added in this PR do not pass in Chrome. Which suggests that either the tests are incorrect, or Chromium doesn’t actually remove the service worker immediately. My local manual testing shows that the service worker still responds to requests on any page that was open when CSD was delivered.

@wanderview wanderview merged commit 8be01b6 into web-platform-tests:master Oct 7, 2019
@asutherland
Copy link
Contributor

Firefox/Gecko bug to make the test happy: https://bugzilla.mozilla.org/show_bug.cgi?id=1589814

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants