add a few code comments

This commit is contained in:
Andre Staltz 2024-02-27 18:03:35 +02:00
parent 60afd4b64b
commit c31580a961
No known key found for this signature in database
GPG Key ID: 9EDE23EA7E8A4890
2 changed files with 6 additions and 0 deletions

View File

@ -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) {

View File

@ -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])
{