Description
IndexedDB data stored on disk may get corrupted or partially lost due to several reasons including user action. Attempts by the site to read such data fail persistently, and these failures are surfaced differently by each browser.
Issue #423 specified the DOMException
type for one such scenario, but this has an impact only if developers update their sites to handle this specific error appropriately.
Can we do more to ensure that the "right thing" happens in these scenarios?
We should note that:
- Sites may store relational data across object stores and/or databases.
- Sites may even store metadata about IndexedDB data in other storage such as LocalStorage.
- The impact of and recoverability potential from partial data corruption/loss varies across sites based on the nature of data stored.
Considering the above, it is best left to the individual sites to handle these scenarios as suits their specific usage patterns. Discussions and efforts have been ongoing to surface sufficiently detailed errors to the sites so that they are equipped to handle them appropriately (#423, whatwg #75).
However, a majority of sites may not handle these errors at all, in which case reads of the affected data will persistently fail. Should we attempt to mitigate these errors by deleting the entire site data (perhaps limited to the containing storage bucket) if we get a strong signal that the site does not handle these errors?