New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 605382 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 1
Type: Bug



Sign in to add a comment

Service worker fetches the script from the network on each update attempt

Project Member Reported by falken@chromium.org, Apr 21 2016

Issue description

SW update checks are supposed to hit the network a max of once every 24 hours.

But the code to update the last update time was broken by https://chromium.googlesource.com/chromium/src/+/57ebec5b7cce00100000763371c56bc4991b56dd

Now SW is hitting the network on each update attempt, which is triggered on each navigation to site.

This is a regression in M50. I'd like to fix and merge to M50.
 

Comment 1 by bke...@mozilla.com, Apr 21 2016

Just to clarify, a navigate update should make a request but not bypass the HTTP cache when it's been less than 24 hours, right?  I thought a site could set a max-age:0 to get updates on every navigation.

Comment 2 by falken@chromium.org, Apr 21 2016

bkelly@ yep, I was just simplifying the bug. Maybe I should have written: SW update checks are supposed to bypass the HTTP cache a max of once every 24 hours.

Comment 3 by bke...@mozilla.com, Apr 21 2016

No problem.  I just wanted to double check I wasn't confused.  Thanks!

Comment 4 by gov...@chromium.org, Apr 22 2016

If your change is baked/verified in Canary and safe to merge, please request a merge to M50 by applying "Merge-Request-50" label. Thank you.

Comment 5 by gov...@chromium.org, Apr 22 2016

Cc: tinazh@chromium.org
Project Member

Comment 6 by bugdroid1@chromium.org, Apr 22 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/82b3853597f585e25ba051cb6b1ac9063430883f

commit 82b3853597f585e25ba051cb6b1ac9063430883f
Author: falken <falken@chromium.org>
Date: Fri Apr 22 04:09:19 2016

service worker: Bump update time even when the script was identical

This regressed in https://chromium.googlesource.com/chromium/src/+/57ebec5b7cce00100000763371c56bc4991b56dd

Also make the unit test more thorough and realistic:
* It was using StopWorker() when the script was identical, but after the change above
production doesn't take that path
* don't use force_bypass_cache_for_scripts since in production that's only used
by DevTools

BUG= 605382 

Review URL: https://codereview.chromium.org/1903043005

Cr-Commit-Position: refs/heads/master@{#389025}

[modify] https://crrev.com/82b3853597f585e25ba051cb6b1ac9063430883f/content/browser/service_worker/embedded_worker_instance.cc
[modify] https://crrev.com/82b3853597f585e25ba051cb6b1ac9063430883f/content/browser/service_worker/service_worker_job_unittest.cc
[modify] https://crrev.com/82b3853597f585e25ba051cb6b1ac9063430883f/content/browser/service_worker/service_worker_register_job.cc
[modify] https://crrev.com/82b3853597f585e25ba051cb6b1ac9063430883f/content/browser/service_worker/service_worker_register_job.h

Comment 7 by falken@chromium.org, Apr 25 2016

Still waiting for this to hit Canary.

Comment 8 by falken@chromium.org, Apr 27 2016

Labels: Merge-Request-50
Verified in Canary. No new crashes either.

Comment 9 by tin...@google.com, Apr 27 2016

Labels: -Merge-Request-50 Merge-Review-50 Hotlist-Merge-Review
[Automated comment] Request affecting a post-stable build (M50), manual review required.
Labels: -Merge-Review-50 Merge-Approved-50
Approving the merge to M50 branch 2661 based on comment #8 after discussing with Tina. Please merge before 1:00 PM PST today as we're cutting M50 stable candidate soon. Thank you.
Project Member

Comment 11 by bugdroid1@chromium.org, Apr 27 2016

Labels: -merge-approved-50 merge-merged-2661
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e17714d7cfd6cb4de0e2bc38ff5ba269290d58e9

commit e17714d7cfd6cb4de0e2bc38ff5ba269290d58e9
Author: Nate Chapin <japhet@chromium.org>
Date: Wed Apr 27 18:59:49 2016

service worker: Bump update time even when the script was identical

This regressed in https://chromium.googlesource.com/chromium/src/+/57ebec5b7cce00100000763371c56bc4991b56dd

Also make the unit test more thorough and realistic:
* It was using StopWorker() when the script was identical, but after the change above
production doesn't take that path
* don't use force_bypass_cache_for_scripts since in production that's only used
by DevTools

BUG= 605382 

Review URL: https://codereview.chromium.org/1903043005

Cr-Commit-Position: refs/heads/master@{#389025}
(cherry picked from commit 82b3853597f585e25ba051cb6b1ac9063430883f)

Review URL: https://codereview.chromium.org/1923143005 .

Cr-Commit-Position: refs/branch-heads/2661@{#642}
Cr-Branched-From: ef6f6ae5e4c96622286b563658d5cd62a6cf1197-refs/heads/master@{#378081}

[modify] https://crrev.com/e17714d7cfd6cb4de0e2bc38ff5ba269290d58e9/content/browser/service_worker/embedded_worker_instance.cc
[modify] https://crrev.com/e17714d7cfd6cb4de0e2bc38ff5ba269290d58e9/content/browser/service_worker/service_worker_job_unittest.cc
[modify] https://crrev.com/e17714d7cfd6cb4de0e2bc38ff5ba269290d58e9/content/browser/service_worker/service_worker_register_job.cc
[modify] https://crrev.com/e17714d7cfd6cb4de0e2bc38ff5ba269290d58e9/content/browser/service_worker/service_worker_register_job.h

Labels: Merge-Request-51
Thanks for merging the patch. I'd also like to merge to M51.

Comment 13 by tin...@google.com, Apr 28 2016

Labels: -Merge-Request-51 Merge-Approved-51 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M51 (branch: 2704)
Please merge your change to M51 branch 2704 before 5:00 PM PST, tomorrow (Friday), so we can take it in for next week M51 beta release. Thank you.
Project Member

Comment 15 by bugdroid1@chromium.org, Apr 29 2016

Labels: -merge-approved-51 merge-merged-2704
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f57cc45fa30461dea0e1b57d82634c941e519c94

commit f57cc45fa30461dea0e1b57d82634c941e519c94
Author: Matt Falkenhagen <falken@chromium.org>
Date: Thu Apr 28 23:59:27 2016

service worker: Bump update time even when the script was identical

This regressed in https://chromium.googlesource.com/chromium/src/+/57ebec5b7cce00100000763371c56bc4991b56dd

Also make the unit test more thorough and realistic:
* It was using StopWorker() when the script was identical, but after the change above
production doesn't take that path
* don't use force_bypass_cache_for_scripts since in production that's only used
by DevTools

BUG= 605382 

Review URL: https://codereview.chromium.org/1903043005

Cr-Commit-Position: refs/heads/master@{#389025}
(cherry picked from commit 82b3853597f585e25ba051cb6b1ac9063430883f)

Review URL: https://codereview.chromium.org/1931153002 .

Cr-Commit-Position: refs/branch-heads/2704@{#298}
Cr-Branched-From: 6e53600def8f60d8c632fadc70d7c1939ccea347-refs/heads/master@{#386251}

[modify] https://crrev.com/f57cc45fa30461dea0e1b57d82634c941e519c94/content/browser/service_worker/embedded_worker_instance.cc
[modify] https://crrev.com/f57cc45fa30461dea0e1b57d82634c941e519c94/content/browser/service_worker/service_worker_job_unittest.cc
[modify] https://crrev.com/f57cc45fa30461dea0e1b57d82634c941e519c94/content/browser/service_worker/service_worker_register_job.cc
[modify] https://crrev.com/f57cc45fa30461dea0e1b57d82634c941e519c94/content/browser/service_worker/service_worker_register_job.h

Status: Fixed (was: Started)

Sign in to add a comment