From ad67330d20adbed4a099c98fad989c075cc7ad3d Mon Sep 17 00:00:00 2001 From: Ricky Stretch Date: Mon, 23 Mar 2026 17:29:57 -0400 Subject: [PATCH] update --- frontend/public/sw.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/frontend/public/sw.js b/frontend/public/sw.js index 66efcf8..9ebbe2f 100644 --- a/frontend/public/sw.js +++ b/frontend/public/sw.js @@ -43,9 +43,14 @@ self.addEventListener('activate', (event) => { self.addEventListener('fetch', (event) => { const url = event.request.url; - if (url.includes('/api/') || url.includes('/socket.io/') || url.includes('/manifest.json')) { - return; - } + + // Only intercept same-origin requests — never intercept cross-origin calls + // (Firebase API, Google CDN, socket.io CDN, etc.) or specific local paths. + // Intercepting cross-origin requests causes Firebase SDK calls to return + // cached HTML, producing "unsupported MIME type" errors and breaking FCM. + if (!url.startsWith(self.location.origin)) return; + if (url.includes('/api/') || url.includes('/socket.io/') || url.includes('/manifest.json')) return; + event.respondWith( fetch(event.request).catch(() => caches.match(event.request)) );