mirror of https://codeberg.org/pzp/pzp-db.git
add a few code comments
This commit is contained in:
parent
60afd4b64b
commit
c31580a961
|
@ -273,6 +273,11 @@ function initDB(peer, config) {
|
|||
})
|
||||
|
||||
/**
|
||||
* TODO: To fix. Notice that some synchronous read APIs such as `db.get()`,
|
||||
* `db.msgs()`, `db.getTangle()` etc may read an *inconsistent* state of the
|
||||
* `recs` array while rescanning is in progress. This may mean duplicate msgs
|
||||
* are read. One possible fix for this is to make all public APIs async.
|
||||
*
|
||||
* @param {CB<void>} cb
|
||||
*/
|
||||
function rescanLogPostCompaction(cb) {
|
||||
|
|
|
@ -71,6 +71,7 @@ test('del()', async (t) => {
|
|||
await p(peer.db.log.compact)()
|
||||
assert('compacted')
|
||||
|
||||
// Delete 4 so we can test that its log offset was updated post-compaction
|
||||
await p(peer.db.del)(msgIDs[4])
|
||||
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue