Commit 32312e4f authored by Yusei Tahara's avatar Yusei Tahara Committed by Romain Courteaud

[erp5_web_renderjs_ui] If service worker failed to install cache, unregister...

[erp5_web_renderjs_ui] If service worker failed to install cache, unregister this service worker explicitly.
parent 61c6ea81
......@@ -215,11 +215,13 @@
return self.skipWaiting();
}
})
.catch(function () {
.catch(function (error) {
// Since we do not allow to override existing cache, if cache installation
// failed, we need to delete the cache completely.
caches.delete(CACHE_NAME);
throw "Download failed! Deleted " + CACHE_NAME;
// Explicitly unregister service worker else it may not be done.
self.registration.unregister();
throw error;
});
}
})
......
......@@ -228,7 +228,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>976.15237.62291.34798</string> </value>
<value> <string>976.15482.50361.52206</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -246,7 +246,7 @@
</tuple>
<state>
<tuple>
<float>1559902712.53</float>
<float>1559917201.4</float>
<string>UTC</string>
</tuple>
</state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment