Re: [IndexedDB] Report data loss to script (#30)

Chrome has shipped two additional properties:
```webidl
enum IDBDataLossAmount { "none", "total" };
partial interface IDBVersionChangeEvent {
  readonly attribute IDBDataLossAmount dataLoss;
  readonly attribute DOMString dataLossMessage; 
};
```
With the speclet: if backing store corruption is detected when a database is opened, the backing store will be deleted and thus the open request will be treated as an initial open/upgrade; `dataLoss` will be set to `"total"` indicating that the database was deleted. This allows sites to reconcile out-of-band data (cookies, localStorage). 

This isn't great but it works.

Another idea that we thought of is firing an event of some type. Possibly at the connection (`IDBDatabase`), or the open request (`IDBOpenDBRequest`), or maybe even at the factory (`IDBFactory`) when a backing store error is encountered.

---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/IndexedDB/issues/30#issuecomment-129591069

Received on Monday, 10 August 2015 20:11:07 UTC