Skip to content

Commit

Permalink
append may be applied in current tick
Browse files Browse the repository at this point in the history
  • Loading branch information
chm-diederichs committed Jun 11, 2024
1 parent 6df6b04 commit c4750a3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,11 @@ module.exports = class Autobase extends ReadyResource {
this._append(value)
}

await this._bump()
// await in case append is in current tick
if (this._advancing) await this._advancing

// only bump if there are unflushed nodes
if (this._appending !== null) return this._bump()
}

_append (value) {
Expand Down

0 comments on commit c4750a3

Please sign in to comment.