Change to reporting for certain error cases that were previously reported with a DOMException and the message "Failed to read large IndexedDB value". Chromium will now raise a DOMException with the name "NotFoundError" when the file containing the data being read by an IDBRequest is missing from the disk so that sites can take the appropriate corrective action when an unrecoverable failure occurs. Corrective actions could include deleting the entry from the DB, notifying the user, re-fetching the data from servers, etc. More details: a large value (above a specific size threshold) written to IndexedDB is not stored directly in the underlying LevelDB database but instead stored as a separate file. An IndexedDB read request for this value looks up the blob reference from LevelDB, reads the blob, then unwraps and returns the stored value. If a failure occurs in this process, the browser fires an "error" event and sets the error property on the IDBRequest to a DOMException with the message "Failed to read large IndexedDB value". The failure could be recoverable (caused by low memory) or unrecoverable (the blob file is missing from the disk). This feature updates the name to "NotFoundError" to enable distinguishing recoverable and unrecoverable cases.
None
Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?
None
None
This change is in the blink layer of the IndexedDB API implementation and hence applies to all Blink platforms.
This is a simple change to the error type when a failure occurs due to a specific cause. Web developers can choose to update their sites to respond differently to this specific error, but existing general error handling keyed to the "Failed to read large IndexedDB value" message will continue to work. Hence, this is unlikely to break sites and is therefore not behind a feature flag.
Shipping on desktop | 130 |
Shipping on Android | 130 |
Shipping on WebView | 130 |
Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).
NoneHi! A couple of questions:
What was the DOMException.name before this change?
Do we know what do other browsers do in this situation? Or is
LevelDB only used by Chromium?
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/66e98e07.2b0a0220.195547.0126.GAE%40google.com.
Thanks,
Abhishek
You don't often get email from mike...@chromium.org.
Learn why this is important
|
Sounds good - thx!
Thanks,
Abhishek
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CY8PR00MB15074249A0CDEF0E254CAAE790632%40CY8PR00MB1507.namprd00.prod.outlook.com.
Thanks,
Abhishek
You don't often get email from dom...@chromium.org.
Learn why this is important
|
Thanks,
Abhishek
Thanks,
Abhishek
Update: A spec PR has been merged to update the exception type to be "NotReadableError" for these failures. Thank you for your inputs and guidance, Domenic, Joshua and Evan!
I'll make these follow-up changes in Chromium, still tracked by crbug.com/362123231 :
Update the exception type from "NotFoundError" to "NotReadableError" for unrecoverable failures arising from data loss. Update the exception type from "DataError" to "UnknownError" for transient failures. Update the exception message to be more effective in conveying the nature of the error to developers.The above changes will go out in M132 though (since M131 branched out this week), while the original change that started this thread (changing the error type to "NotFoundError") will be reaching M130 Stable this week.So interested developers would need to update their error handlers again for M132, which isn't ideal...Should we aim to maintain some sort of compatibility for a couple of releases, or is this an acceptable tradeoff for converging on a common error and a detailed message?
Type of failure
|
DOMException name
|
DOMException message
|
Unrecoverable (missing file)
|
NotReadableError
|
"Data lost due to missing file. Affected record should be considered irrecoverable"
|
Recoverable/transient
|
UnknownError
|
"Failed to read large IndexedDB value"
|
Thanks,
Abhishek