Skip to content

IndexedDB corrupted data #12

@aimozg

Description

@aimozg

Having trouble with IndexedDbBackend.

  1. If I call EdgeVec.load but the database doesn't exist yet, the promise is left hanging and the database becomes inconsistent:
  • read and write don't reject the promise on exception => the calling code left hanging.
  • read call doesn't hook onupgradeneeded => no files collections created, but the DB is created and marked at version 1.
  1. After fixing this in my local setup, I still can't load the data - EdgeVec.load fails with "corrupted data: Deserialization failed: This is a feature that PostCard will never implement"

Sample code (empty database, same error if I insert anything).

  import * as edgevec from "edgevec";

  await edgevec.default();
  const config = new edgevec.EdgeVecConfig(768);
  config.metric = 'cosine';
  const db = new edgevec.EdgeVec(config);
  await db.save('test');
  const db2 = await edgevec.EdgeVec.load('test');
  console.log('success')

=>

Uncaught (in promise) {
    "code": "ERR_CORRUPTION",
    "message": "corrupted data: Deserialization failed: This is a feature that PostCard will never implement"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions