earthstar-project / earthstar

Storage for private, distributed, offline-first applications.
https://earthstar-project.org
GNU Lesser General Public License v3.0
632 stars 20 forks source link

ReplicaDriverIndexedDB docs are undefined #234

Closed basham closed 2 years ago

basham commented 2 years ago

In the getIndexedDB() method, the docs are retrieved from the database like this:

const docs = retrieval.result;

And it is soon used like this:

Object.entries(docs.byPathAndAuthor)

However, the object that is returned from docs is actually in the signature { id: 'allDocs', docs: {...} }. Line 78 (v7.1.0) could be updated like this, in order to make it work:

const docs = retrieval.result?.docs;
sgwilym commented 2 years ago

I'm pretty sure I've fixed this too as of v8.2.4. Thanks for reporting it!