Bug 1644780 Comment 20 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to Jan Varga [:janv] from comment #19)
> We need to solve this in general somehow, but in this concrete case we should just throw away entire cache ?

I think the general plan is:
1) Enhance mozStorage in bug 1125157 to provide corruption notifications.
2) On corruption, wipe the storage bucket, which currently means the entire origin.  (Currently this is specified by https://storage.spec.whatwg.org/#storage-endpoints to include LocalStorage but we can do a carve-out.)  I think we've discussed having the DirectoryLock class expose a method for this which could then notify the nsIClearDataService.

Doing a localize removal of the cache is probably an okay stop-gap since the ServiceWorkerManager/ScriptLoader will notice the storage has gone away the next time it goes to try and wake up the ServiceWorker and will remove the registration.
(In reply to Jan Varga [:janv] from comment #19)
> We need to solve this in general somehow, but in this concrete case we should just throw away entire cache ?

I think the general plan is:
1) Enhance mozStorage in bug 1125157 to provide corruption notifications.
2) On corruption, wipe the storage bucket, which currently means the entire origin.  (Currently this is specified by https://storage.spec.whatwg.org/#storage-endpoints to include LocalStorage but we can do a carve-out.)  I think we've discussed having the DirectoryLock class expose a method for this which could then notify the nsIClearDataService.

Doing a localized removal of the cache (database) without doing things at the bucket/origin level is probably an okay stop-gap since the ServiceWorkerManager/ScriptLoader will notice the storage has gone away the next time it goes to try and wake up the ServiceWorker and will remove the registration.

Back to Bug 1644780 Comment 20