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

Adds updateViaCache #6850

Merged
merged 14 commits into from
Jul 29, 2021
Merged

Adds updateViaCache #6850

merged 14 commits into from
Jul 29, 2021

Conversation

Blakelist7
Copy link
Contributor

@Blakelist7 Blakelist7 commented Jul 13, 2021

Adds updateViaCache() method to ServiceWorkerRegistration.

Fixes #6729

Adds `updateViaCache()` method to ServiceWorkerRegistration.
@Blakelist7 Blakelist7 requested a review from a team as a code owner July 13, 2021 08:59
@Blakelist7 Blakelist7 requested review from jpmedley and removed request for a team July 13, 2021 08:59
@github-actions
Copy link
Contributor

github-actions bot commented Jul 13, 2021

Preview URLs

Flaws

Note! 1 document with no flaws that don't need to be listed. 🎉

URL: /en-US/docs/Web/API/ServiceWorkerContainer/register
Title: ServiceWorkerContainer.register()
on GitHub
Flaw count: 1

  • broken_links:
    • Can't resolve https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules

URL: /en-US/docs/Web/API/ServiceWorkerRegistration
Title: ServiceWorkerRegistration
on GitHub
Flaw count: 2

  • bad_bcd_links:
    • no explanation!
    • no explanation!

External URLs

URL: /en-US/docs/Web/API/ServiceWorkerContainer/register
Title: ServiceWorkerContainer.register()
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/ServiceWorkerRegistration
Title: ServiceWorkerRegistration
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/ServiceWorkerRegistration/updateViaCache
Title: ServiceWorkerRegistration.updateViaCache
on GitHub

(this comment was updated 2021-07-21 18:15:03.931201)

@Blakelist7
Copy link
Contributor Author

Blakelist7 commented Jul 13, 2021

@hamishwillee can you help me in rephrasing the content of updateViaCache()?

Copy link
Collaborator

@jpmedley jpmedley left a comment

Choose a reason for hiding this comment

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

Thank you for submitting this. This is free of typos, which I really appreciate. There are some matters of MDN style that you need to address. I'm available to answer questions and I'm here to help.

@Blakelist7
Copy link
Contributor Author

Blakelist7 commented Jul 21, 2021

@jpmedley thank you for assisting me : )
I am done with the changes you requested.
I just have one suggestion to make, as you mentioned that updateviacache property is not implemented yet so shall we move it from Methods to Unimplemented properties in ServiceWorkerRegistration.

@Blakelist7 Blakelist7 requested a review from jpmedley July 21, 2021 09:51
Copy link
Collaborator

@jpmedley jpmedley left a comment

Choose a reason for hiding this comment

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

@Blakelist7 Thank you for your patience with this. The style of a reference work is different from the writing style you were taught in school. I think we're almost done, though.

@Blakelist7 Blakelist7 requested a review from jpmedley July 21, 2021 18:14
@robatwilliams
Copy link

updateViaCache on the registration is a getter for the value it was originally registered with, as far as I can see - it's not a method.

https://w3c.github.io/ServiceWorker/#service-worker-registration-updateviacache


ServiceWorkerRegistration.update()
Checks the server for an updated version of the service worker without consulting caches.

Related to these changes. The "without consulting caches" part does seem to be the current behaviour in Chrome and Firefox (the only ones I tried). However I don't see anything in the spec (Update algorithm) that says it should behave this way. That bit was checked in in "initial en-us content checkin" on this repo, so I can't find any discussion/basis for it.

@robatwilliams
Copy link

I reported this about the "without consulting cache" thing, I might be wrong https://bugs.chromium.org/p/chromium/issues/detail?id=1232383.

@jpmedley jpmedley merged commit cad672e into mdn:main Jul 29, 2021
@jpmedley
Copy link
Collaborator

@robatwilliams Can you please open a ticket on this issue and we'll handle it in a separate PR. Long-lived PRs have a tendency to acquire merge conflicts, and this one was getting a little old.

Anurella added a commit to Anurella/content that referenced this pull request Jul 29, 2021
* 'main' of https://github.com/mdn/content:
  Adds updateViaCache (mdn#6850)
  Remove mentions of RTCDataChannelInit dictionary (mdn#7148)
  chore(deps): bump @mdn/yari from 0.4.652 to 0.4.658 (mdn#7427)
  Update PULL_REQUEST_TEMPLATE in GitHub actions (mdn#7405)
  Fix example in WebGL2RenderingContext.getBufferSubData (mdn#7418)
  Make CSS dl elements MArkdown-convertible (mdn#7403)
  Clarify WebGLContext.drawElements' count parameter (mdn#7417)
  Fix live sample for custom input validation (mdn#7408)
  Remove use of figure element from Web/CSS (mdn#7409)
  the label in the continue is optional. (mdn#7406)
  Change 'semantic' to 'semantics' (mdn#7401)
  Replace offensive words in CORS documentation (mdn#7396)
@robatwilliams
Copy link

Apologies, I was wrong about the issue and didn't mean to distract.

However the original point still stands, yet the PR was merged:

updateViaCache on the registration is a getter for the value it was originally registered with, as far as I can see - it's not a method.

</li>
</ul>
</li>
<li><code>updateViaCache</code>: A string indicating how much of a service worker's resources will be updated when a call is made to {{domxref('ServiceWorkerRegistration.updateViaCache')}}. Valid values are:

Choose a reason for hiding this comment

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

Should say "when a calle is made to ServiceWorkerRegistration.update()"

@@ -72,6 +72,8 @@ <h2 id="Methods">Methods</h2>
<dd>Checks the server for an updated version of the service worker without consulting caches.</dd>
<dt>{{domxref("ServiceWorkerRegistration.unregister()")}}</dt>
<dd>Unregisters the service worker registration and returns a {{jsxref("Promise")}}. The service worker will finish any ongoing operations before it is unregistered.</dd>
<dt>{{domxref("ServiceWorkerRegistration.updateViaCache")}}</dt>

Choose a reason for hiding this comment

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

This is actually a property which allows you to retrieve the original value provided at registration.

@@ -72,6 +72,8 @@ <h2 id="Methods">Methods</h2>
<dd>Checks the server for an updated version of the service worker without consulting caches.</dd>

Choose a reason for hiding this comment

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

"without consulting caches" should be removed, or elaborated to mention respecing updateViaCache

---
<div>{{APIRef("Service Workers API")}}</div>

<p>The <code><strong>updateViaCache()</strong></code> method of the

Choose a reason for hiding this comment

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

As mentioned in the other comment, it's a property not a method.

https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/update should be mention updateViaCache

@robatwilliams
Copy link

updateViaCache on the registration is a getter for the value it was originally registered with, as far as I can see - it's not a method.

I didn't originally consider it necessary to point out every individual incorrectness on this PR relating to this, but I now have.

Unless I'm misunderstood, IMO this PR should be reverted @jpmedley

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue with "ServiceWorkerRegistration": description for updateViaCache is missing
3 participants