Test/database (#38)

* test: Database.

* test: Remove caching test. Caching is superseded by the various storage options.

* test: db2 replicates data in existing db1.

* test: Move event tests to generic database tests.

* test: Single instance cleanup.

* fix: Linting.

* Fix Sync race condition (#39)

* test: Fix key path import.

---------

Co-authored-by: Haad <haadcode@users.noreply.github.com>
This commit is contained in:
Hayden Young
2023-03-11 21:01:05 +08:00
committed by GitHub
parent bc816c7e2e
commit a40bc8bdcf
10 changed files with 391 additions and 99 deletions

View File

@@ -39,7 +39,9 @@ const Database = async ({ OpLog, ipfs, identity, address, name, accessController
events.emit('update', entry)
return entry.hash
}
return queue.add(task)
const hash = await queue.add(task)
await queue.onIdle()
return hash
}
const applyOperation = async (bytes) => {
@@ -53,7 +55,6 @@ const Database = async ({ OpLog, ipfs, identity, address, name, accessController
}
}
await queue.add(task)
await queue.onIdle()
}
const close = async () => {