sw: Remove fetch handler from service worker

In current state, service worker overloads every "connection error"
kind of reaction to a plaintext 200 saying "Offline.", which leads
to terribly undebuggable situations as the browser decides to cache
this as an image, and then someone's pfp is broken literally
forever unless you Ctrl+Shift+R every time you reload frontend.

This change removes the handler, because it is unclear how we even
benefit from it being there.
This commit is contained in:
Michcio 2022-09-06 23:24:23 +02:00
parent 5a9d4a3759
commit 026941ce77

View file

@ -23,13 +23,6 @@ self.addEventListener('activate', ev => {
);
});
self.addEventListener('fetch', ev => {
ev.respondWith(
fetch(ev.request)
.catch(() => new Response(`Offline. Service Worker @${_VERSION_}`, { status: 200 }))
);
});
self.addEventListener('push', ev => {
// クライアント取得
ev.waitUntil(self.clients.matchAll({