Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

service-worker timestamp is incorrect

my service-worker is not activating on page reload. While trying to figure out the reason I noticed that in Chrome it shows 1/1/1970 as receive date and I think this could be a reason. Who knows why receive date is incorrect and does it really affect on service-worker activation.

enter image description here

enter image description here

like image 617
Hayk Sahakyan Avatar asked Nov 06 '22 22:11

Hayk Sahakyan


1 Answers

I'm not sure why that date is used in the DevTools interface. (If you'd like, you can address that issue by filing a bug.)

I don't believe that the date has anything to do with the actual behavior you're seeing, though. What it looks like is that you have an active service worker, and a newly installed service worker that's in the waiting state. That's normal, and the new service worker will remain in waiting until one of two things happen: all open clients controlled by the previous service worker is closed (reloading isn't enough), or you call self.skipWaiting() from within the new service worker.

There's more details about this scenario at https://developers.google.com/web/fundamentals/primers/service-workers/lifecycle#waiting

like image 157
Jeff Posnick Avatar answered Nov 16 '22 22:11

Jeff Posnick