elharony / FEND-Restaurant-Reviews-App

A Web App helps you finding nearby restaurants, read customers reviews, and more info like its working hours
0 stars 0 forks source link

Service Worker #1

Open cacarr-pdxweb opened 5 years ago

cacarr-pdxweb commented 5 years ago

Sorry to bother you. I was just wondering if this sw.js passed review without a fetch event.

elharony commented 5 years ago

Hi @cacarr-pdxweb ,

I believe it did pass without the sw.js, as I didn't refactor/fix/update my Front End Nanodegree Projects until now. Maybe I forgot about it & the reviewer forgot as well?

cacarr-pdxweb commented 5 years ago

Ah, so you think it might have passed without an sw.js file at all? I guess that must have been an oversight on the part of the reviewer.

I was curious because I submitted this project with just an install event, no fetch event (or explicit activate to clear old caches). It didn't pass -- but the odd thing is, the whole application shell cached by the install event loaded offline; all pages, without any of them being previously visited. From what I understand now, it shouldn't. But it did -- don't know how. I figured if all the pages were available offline, it should pass.

I don't know -- maybe some peculiarity of my development environment, or Chrome is behaving in some way it didn't used to. Was all very strange.

So for any future FEND students stopping by this repo, you're going to need at least fetch event in your sw.js also, in addition to the install event.