Skip to content

Specify the exception for read failures arising due to partial data loss on the file system  #423

Closed
@abhishek-shanthkumar

Description

@abhishek-shanthkumar

IndexedDB data stored on the file system can be lost due to factors beyond the browser's control, such as when users directly delete the files containing the data.
Total data loss of the database or object store is visible to the script as an absence of data, and can be appropriately handled by it.
However, since the current specification does not mandate consistent data storage, there is a chance of partial data loss where the entry for a record exists in the object store but the contents of the record are lost.
For example, both Chromium and Firefox store blobs and large values in files separate from the main database, which only contains references to these files.
When those files are deleted, the references in the database become dangling and attempts to read the data fail permanently.

The specification does not cover the above scenario, and hence the DOMException thrown varies by browser:

  • Chromium:
    • name: NotFoundError (updated recently)
    • message: "Failed to read large IndexedDB value"
  • Firefox:
    • name: UnknownError
    • message: "The operation failed for reasons unrelated to the database itself and not covered by any other error code."

Specifying a common DOMException for such cases of partial data loss will help developers handle these scenarios consistently across browsers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions