content icon indicating copy to clipboard operation
content copied to clipboard

Fix caches.AddAll that is not origin-relative

Open softorangetech1122 opened this issue 3 years ago • 6 comments

Summary

Fixes #19665 by saying it is document-and-service-worker-relative, not origin-relative.

Motivation

It's incorrect, and newbies to service workers may not realize this.

Supporting details

Issue #19665.

Related issues

Fixes #19665

Metadata

  • [ ] Adds a new document
  • [ ] Rewrites (or significantly expands) a document
  • [x] Fixes a typo, bug, or other error

softorangetech1122 avatar Aug 25 '22 04:08 softorangetech1122

Preview URLs

Flaws

None! 🎉

External URLs

URL: /en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers Title: Using Service Workers on GitHub

No new external URLs

(this comment was updated 2022-09-03 03:09:13.046095)

github-actions[bot] avatar Aug 25 '22 04:08 github-actions[bot]

Thank you for your PR, @softorangetech200 !

In #19665 (comment), @noamr suggests that we should also update:

  • https://developer.mozilla.org/en-US/docs/Web/API/Cache/addAll
  • https://developer.mozilla.org/en-US/docs/Web/API/Cache/add
  • https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Offline_Service_workers

...with this detail. Do you think you could add these to your PR? Thank you!

I'll ask @noamr about what to add. Thanks.

softorangetech1122 avatar Aug 28 '22 02:08 softorangetech1122

Thank you for your PR, @softorangetech200 ! In #19665 (comment), @noamr suggests that we should also update:

  • https://developer.mozilla.org/en-US/docs/Web/API/Cache/addAll
  • https://developer.mozilla.org/en-US/docs/Web/API/Cache/add
  • https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Offline_Service_workers

...with this detail. Do you think you could add these to your PR? Thank you!

I'll ask @noamr about what to add. Thanks.

Yes, I think we need to add them in all the above. Also in Request.

Note that the URL can also be relative to a regular worker script, not just a service worker.

Perhaps (thinking out loud) the right way to wording would be that those functions receive URLs or requests - basically anything that could be an input to the Request constructor, and in that constructor mention that the URLs are relative to the base URL, which is the document URL or the worker's location.

noamr avatar Aug 28 '22 06:08 noamr

Thank you for your PR, @softorangetech200 ! In #19665 (comment), @noamr suggests that we should also update:

  • https://developer.mozilla.org/en-US/docs/Web/API/Cache/addAll
  • https://developer.mozilla.org/en-US/docs/Web/API/Cache/add
  • https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Offline_Service_workers

...with this detail. Do you think you could add these to your PR? Thank you!

I'll ask @noamr about what to add. Thanks.

Yes, I think we need to add them in all the above. Also in Request.

Note that the URL can also be relative to a regular worker script, not just a service worker.

Perhaps (thinking out loud) the right way to wording would be that those functions receive URLs or requests - basically anything that could be an input to the Request constructor, and in that constructor mention that the URLs are relative to the base URL, which is the document URL or the worker's location.

I'll push all changes later. Thanks!

softorangetech1122 avatar Aug 28 '22 20:08 softorangetech1122

@softorangetech1122 , are you intending to come back to this PR? Otherwise I will have a go at finishing it off myself. Thanks!

wbamberg avatar Oct 22 '22 00:10 wbamberg

@softorangetech1122, this is still waiting in your response to https://github.com/mdn/content/pull/19955#issuecomment-1287544579

sideshowbarker avatar Nov 07 '22 07:11 sideshowbarker

This pull request has merge conflicts that must be resolved before it can be merged.

github-actions[bot] avatar Dec 17 '22 22:12 github-actions[bot]

@wbamberg I went ahead and closed this one for lack of response. https://github.com/mdn/content/pull/19955/files still has the patch (such as it is). No further commits were ever pushed to the PR branch in response to the review comments.

sideshowbarker avatar Dec 18 '22 08:12 sideshowbarker