Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

134
Vistas
Why did the browser never update itself from zombie service worker?

In this brillant talk Alexander Pope: ServiceWorkers Outbreak: index-sw-9a4c43b4b47781ca619eaaf5ac1db.js | JSConf EU 2017: The presenter has a situation where a broken service worker gets installed, and its stuck in the broken state. The presenter tries a kill switch and an empty service worker to remedey it, but there are still some browsers permantely infected. I am trying to understand why it happened, and not do a similar thing.

Here is his code (from 22m:57s):

function onInstall(event) {
    event.waitUntil(
        install(config.version, config.assets)
            .catch((err) => {
                reportError(err);
                // Ok, you know what you're doing, Installing now....
            })
    );
}

It gets stuck because within the call to install he uses cache.addAll(), but long ago Chrome didnt support cache, so this error never bubbled up, and the browser thought it was installed correctly.

Now the browser is reponsible for fetching the sw.js file and checking if its byte different to the currently installed worker. The code to register the new sw.js file is outside of the service worker file. This means even if a service worker is broken, the browser should be able to fetch the new one, determine its different, register it, and activate it (eventually). The newer sw.js file could then check for the presence of cache API. So why are there some clients still in a broken state?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda