A service worker seems to go dormant after a time of inactivity
It will wake up when it needs to
In our case when a sync event is fired
But if a sync event fires from a dormant service worker our python module doesn't exist anymore
To get over this we set a dummy onsync event handler.
when the service worker loads from being dormant we use the waitUntil api to effectively wait for the python module to be reloaded, and then call the real onsync event handler.
To reload the python module we store all loaded modules in indexed-db.
A service worker seems to go dormant after a time of inactivity It will wake up when it needs to In our case when a sync event is fired But if a sync event fires from a dormant service worker our python module doesn't exist anymore
To get over this we set a dummy onsync event handler. when the service worker loads from being dormant we use the
waitUntil
api to effectively wait for the python module to be reloaded, and then call the realonsync
event handler.To reload the python module we store all loaded modules in indexed-db.